|
--- |
|
license: cc-by-nc-4.0 |
|
library_name: chat_tts |
|
pipeline_tag: text-to-audio |
|
--- |
|
|
|
|
|
**We are also training larger-scale models and need computational power and data support. If you can provide assistance, please contact [email protected]. Thank you very much.** |
|
|
|
|
|
First, clone the Git repository: |
|
```bash |
|
git clone https://github.com/2noise/ChatTTS.git |
|
``` |
|
|
|
|
|
|
|
|
|
```python |
|
|
|
import torch |
|
import torchaudio |
|
torch._dynamo.config.cache_size_limit = 64 |
|
torch._dynamo.config.suppress_errors = True |
|
torch.set_float32_matmul_precision('high') |
|
|
|
import ChatTTS |
|
from IPython.display import Audio |
|
|
|
|
|
chat = ChatTTS.Chat() |
|
chat.load_models(compile=False) |
|
|
|
|
|
texts = [ |
|
"So we found being competitive and collaborative was a huge way of staying motivated towards our goals, so one person to call when you fall off, one person who gets you back on then one person to actually do the activity with.", |
|
] |
|
|
|
|
|
wavs = chat.infer(texts) |
|
Audio(wavs[0], rate=24_000, autoplay=True) |
|
|
|
|
|
torchaudio.save("output.wav", torch.from_numpy(wavs[0]), 24000) |
|
``` |
|
**For more usage examples, please refer to the [example notebook](https://github.com/2noise/ChatTTS/blob/main/example.ipynb), which includes parameters for finer control over the generated speech, such as specifying the speaker, adjusting speech speed, and adding laughter.** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The information provided in this document is for academic purposes only. It is intended for educational and research use, and should not be used for any commercial or legal purposes. The authors do not guarantee the accuracy, completeness, or reliability of the information. |