CoolFace
Modelpublic

KevinC1992/ChatTTS

sourceHugging Facecc-by-nc-4.0updated 3mo agoView on Hugging Face
0likes6downloads
README.md55 linesDownload Raw Back to root
1---2license: cc-by-nc-4.03library_name: chat_tts4pipeline_tag: text-to-audio5---6 7 8**We are also training larger-scale models and need computational power and data support. If you can provide assistance, please contact OPEN-SOURCE@2NOISE.COM. Thank you very much.**9 10## Clone the Repository11First, clone the Git repository:12```bash13git clone https://github.com/2noise/ChatTTS.git14```15 16## Model Inference17 18 19```python20# Import necessary libraries and configure settings21import torch22import torchaudio23torch._dynamo.config.cache_size_limit = 6424torch._dynamo.config.suppress_errors = True25torch.set_float32_matmul_precision('high')26 27import ChatTTS28from IPython.display import Audio29 30# Initialize and load the model: 31chat = ChatTTS.Chat()32chat.load_models(compile=False) # Set to True for better performance33 34# Define the text input for inference (Support Batching)35texts = [36    "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.",37    ]38 39# Perform inference and play the generated audio40wavs = chat.infer(texts)41Audio(wavs[0], rate=24_000, autoplay=True)42 43# Save the generated audio 44torchaudio.save("output.wav", torch.from_numpy(wavs[0]), 24000)45```46**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.**47 48 49 50 51 52 53### Disclaimer: For Academic Purposes Only54 55The 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.