bark voice cloning HuBERT quantizer
1.0.0
このコードはPython 3.10で動作しますが、他のバージョンではテストしていません。一部の古いバージョンには問題があります。
今は可能です。
開発者向け:
みんなのために:
これらのものがあなたの音声入力にないことを確認してください:(具体的には)
何が良い迅速なオーディオを作るのですか? (順不同)
| 名前 | ヒューバートモデル | 量子版 | エポック | 言語 | データセット |
|---|---|---|---|---|---|
| Quantifier_hubert_base_ls960.pth | ヒューバートベース | 0 | 3 | Eng | Gitmylo/Bark-Semantic-Training |
| Quantifier_hubert_base_ls960_14.pth | ヒューバートベース | 0 | 14 | Eng | Gitmylo/Bark-Semantic-Training |
| Quantifier_v1_hubert_base_ls960_23.pth | ヒューバートベース | 1 | 23 | Eng | Gitmylo/Bark-Semantic-Training |
| 著者 | 名前 | ヒューバートモデル | 量子版 | エポック | 言語 | データセット |
|---|---|---|---|---|---|---|
| hobispl | ポーランド - ハーバーティザー_8_EPOCH.PTH | ヒューバートベース | 1 | 8 | pol | ホビス/バークポーリッシュセマンティックワブトレーニング |
| C0untfloyd | German-Hubert-Quantizer_14_epoch.pth | ヒューバートベース | 1 | 14 | ger | Countfloyd/Bark-German-Semantic-Wav-Training |
from hubert . pre_kmeans_hubert import CustomHubert
import torchaudio
# Load the HuBERT model,
# checkpoint_path should work fine with data/models/hubert/hubert.pt for the default config
hubert_model = CustomHubert ( checkpoint_path = 'path/to/checkpoint' )
# Run the model to extract semantic features from an audio file, where wav is your audio file
wav , sr = torchaudio . load ( 'path/to/wav' ) # This is where you load your wav, with soundfile or torchaudio for example
if wav . shape [ 0 ] == 2 : # Stereo to mono if needed
wav = wav . mean ( 0 , keepdim = True )
semantic_vectors = hubert_model . forward ( wav , input_sample_hz = sr ) import torch
from hubert . customtokenizer import CustomTokenizer
# Load the CustomTokenizer model from a checkpoint
# With default config, you can use the pretrained model from huggingface
# With the default setup from HuBERTManager, this will be in data/models/hubert/tokenizer.pth
tokenizer = CustomTokenizer . load_from_checkpoint ( 'data/models/hubert/tokenizer.pth' ) # Automatically uses the right layers
# Process the semantic vectors from the previous HuBERT run (This works in batches, so you can send the entire HuBERT output)
semantic_tokens = tokenizer . get_token ( semantic_vectors )
# Congratulations! You now have semantic tokens which can be used inside of a speaker prompt file. トレーニングコマンドを実行するだけです。
トレーニング用のセマンティックデータとWAVを作成する簡単な方法は、私のスクリプトであるBark-Data-Genです。しかし、波の作成には、セマンティクスの作成よりも長くないにしても、ほぼ同じ時間がかかることを忘れないでください。そのために生成するのに時間がかかる場合があります。
たとえば、ZIPがオーディオファイルを含むデータセットがある場合は、セマンティクス用のZIP、WAVファイル用のZIP。 「文学」と呼ばれるフォルダーの内部
process.py --path Literature --mode prepare
process.py --path Literature --mode prepare2
process.py --path Literature --mode trainを実行する必要があります
モデルが十分にトレーニングされている場合は、 process.py --path Literature --mode testを実行して最新のモデルをテストできます。
このモデルによって作成されたセマンティクスを使用して生成されたオーディオについては責任を負いません。違法な目的で使用しないでください。