huggingface / huggingface.js

Utilities to use the Hugging Face Hub API
https://hf.co/docs/huggingface.js
MIT License
1.37k stars 213 forks source link

Add ChatTTS download stats #734

Closed NielsRogge closed 3 months ago

NielsRogge commented 4 months ago

This PR ensures download stats are working for https://huggingface.co/2Noise/ChatTTS.

To do:

Wauplin commented 4 months ago

Thanks for the PR @NielsRogge! You can also add a code snippet by updating model-libraries-snippets.ts and importing it correctly in model-libraries.ts. This way users will see a "use in ChatTTS" button on the model page. Snippet would be more or less the same as in model card (to be adapted)

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)

(especially useful if you expect several repos to host ChatTTS models)