Instructions to use Thomcles/Chatterbox-TTS-French with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Chatterbox
How to use Thomcles/Chatterbox-TTS-French with Chatterbox:
# pip install chatterbox-tts import torchaudio as ta from chatterbox.tts import ChatterboxTTS model = ChatterboxTTS.from_pretrained(device="cuda") text = "Ezreal and Jinx teamed up with Ahri, Yasuo, and Teemo to take down the enemy's Nexus in an epic late-game pentakill." wav = model.generate(text) ta.save("test-1.wav", wav, model.sr) # If you want to synthesize with a different voice, specify the audio prompt AUDIO_PROMPT_PATH="YOUR_FILE.wav" wav = model.generate(text, audio_prompt_path=AUDIO_PROMPT_PATH) ta.save("test-2.wav", wav, model.sr) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -61,7 +61,11 @@ def load_tts_model(repo: str, checkpoint_file: str, device: str) -> ChatterboxTT
|
|
| 61 |
|
| 62 |
def synthesize_speech(model: ChatterboxTTS, text: str, audio_prompt_path:str, **kwargs) -> torch.Tensor:
|
| 63 |
with torch.inference_mode():
|
| 64 |
-
return model.generate(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
def save_audio(waveform: torch.Tensor, path: str, sample_rate: int):
|
| 67 |
sf.write(path, waveform.squeeze().cpu().numpy(), sample_rate)
|
|
|
|
| 61 |
|
| 62 |
def synthesize_speech(model: ChatterboxTTS, text: str, audio_prompt_path:str, **kwargs) -> torch.Tensor:
|
| 63 |
with torch.inference_mode():
|
| 64 |
+
return model.generate(
|
| 65 |
+
text=text,
|
| 66 |
+
audio_prompt_path=audio_prompt_path,
|
| 67 |
+
**kwargs
|
| 68 |
+
)
|
| 69 |
|
| 70 |
def save_audio(waveform: torch.Tensor, path: str, sample_rate: int):
|
| 71 |
sf.write(path, waveform.squeeze().cpu().numpy(), sample_rate)
|