text-to-audiochat_ttscc-by-nc-4.0

2Noise/ChatTTS

huggingface.co/2Noise/ChatTTS

1,670Likes
2,969Downloads
2024-10-22Updated
chat_ttssafetensorstext-to-audiolicense:cc-by-nc-4.0region:us

Model card

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.

Clone the Repository

First, clone the Git repository: ``bash git clone https://github.com/2noise/ChatTTS.git ``

Model Inference

```python # Import necessary libraries and configure settings 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

Initialize and load the model:

chat = ChatTTS.Chat() chat.load_models(compile=False) # Set to True for better performance

Define the text input for inference (Support Batching)

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.", ]

Perform inference and play the generated audio

wavs = chat.infer(texts) Audio(wavs[0], rate=24_000, autoplay=True)

Save the generated audio

torchaudio.save("output.wav", torch.from_numpy(wavs[0]), 24000) ``` For more usage examples, please refer to the example notebook, which includes parameters for finer control over the generated speech, such as specifying the speaker, adjusting speech speed, and adding laughter.

Disclaimer: For Academic Purposes Only

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.

Mirrored from the Hugging Face Hub and served from the Conceptio Open Knowledge Archive. Read the original card at https://huggingface.co/2Noise/ChatTTS.