Skip to content

Commit d2d6220

Browse files
NielsRoggeWauplin
andauthored
Add ChatTTS download stats (#734)
This PR ensures download stats are working for https://huggingface.co/2Noise/ChatTTS. To do: - [x] I assume the repo must have `library_name: chat_tts` in its metadata for this to work. Made a PR on the repo: https://huggingface.co/2Noise/ChatTTS/discussions/10 --------- Co-authored-by: Lucain <[email protected]>
1 parent 143581a commit d2d6220

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

packages/tasks/src/model-libraries-snippets.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,20 @@ export const voicecraft = (model: ModelData): string[] => [
553553
model = VoiceCraft.from_pretrained("${model.id}")`,
554554
];
555555

556+
export const chattts = (): string[] => [
557+
`import ChatTTS
558+
import torchaudio
559+
560+
chat = ChatTTS.Chat()
561+
chat.load_models(compile=False) # Set to True for better performance
562+
563+
texts = ["PUT YOUR TEXT HERE",]
564+
565+
wavs = chat.infer(texts, )
566+
567+
torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)`,
568+
];
569+
556570
export const mlx = (model: ModelData): string[] => [
557571
`pip install huggingface_hub hf_transfer
558572

packages/tasks/src/model-libraries.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
111111
wildcard: { path: "*.npz" },
112112
},
113113
},
114+
chat_tts: {
115+
prettyLabel: "ChatTTS",
116+
repoName: "ChatTTS",
117+
repoUrl: "https://github.com/2noise/ChatTTS.git",
118+
filter: false,
119+
countDownloads: { term: { path: "asset/GPT.pt" } },
120+
snippets: snippets.chattts,
121+
},
114122
diffusers: {
115123
prettyLabel: "Diffusers",
116124
repoName: "🤗/diffusers",

0 commit comments

Comments
 (0)