bark voice cloning HuBERT quantizer
1.0.0
이 코드는 Python 3.10에서 작동합니다. 다른 버전에서는 테스트하지 않았습니다. 일부 이전 버전에는 문제가 있습니다.
지금 가능합니다.
개발자 :
모두를 위해 :
이러한 것들이 당신의 음성 입력에 있지 않은지 확인하십시오 : (특별한 순서없이)
좋은 프롬프트 오디오를 만드는 것은 무엇입니까? (특별한 순서없이)
| 이름 | 허버트 모델 | Quantizer 버전 | 시대 | 언어 | 데이터 세트 |
|---|---|---|---|---|---|
| Quantifier_hubert_base_ls960.pth | 허버트 기지 | 0 | 3 | 잉그 | gitmylo/껍질-미용 훈련 |
| Quantifier_hubert_base_ls960_14.pth | 허버트 기지 | 0 | 14 | 잉그 | gitmylo/껍질-미용 훈련 |
| Quantifier_V1_HUBERT_BASE_LS960_23.pth | 허버트 기지 | 1 | 23 | 잉그 | gitmylo/껍질-미용 훈련 |
| 작가 | 이름 | 허버트 모델 | Quantizer 버전 | 시대 | 언어 | 데이터 세트 |
|---|---|---|---|---|---|---|
| Hobispl | Polish-Hubert-Quantizer_8_epoch.pth | 허버트 기지 | 1 | 8 | 폴 | 호비스/껍질-폴란드-미용-웨이브 훈련 |
| C0untfloyd | German-Hubert-Quantizer_14_epoch.pth | 허버트 기지 | 1 | 14 | 게르 | 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입니다. 그러나 wavs의 창조는 의미론의 창조보다 길지 않으면 동시에 시간이 걸릴 것임을 기억하십시오. 그로 인해 생성하는 데 시간이 걸릴 수 있습니다.
예를 들어, 오디오 파일이 포함 된 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 실행할 수 있습니다.
이 모델에서 만든 의미론을 사용하여 생성 된 오디오에 대해 책임을지지 않습니다. 불법적 인 목적으로 사용하지 마십시오.