From fa1e38952fca3a11b5b11bff6e22526568493485 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 11 May 2025 06:34:17 +0000 Subject: [PATCH] bugfix --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 5bdd0d5..f9a8c27 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,23 @@ # TTS小模型 +我们创建一个webserver, 参考[这里](https://huggingface.com/nari-labs/dia-1.6b)提供的安装和代码 +``` +import soundfile as sf +from dia.model import Dia + +model = Dia.from_pretrained("nari-labs/Dia-1.6B") +text = "[S1] Dia is an open weights text to dialogue model. [S2] You get full control over scripts and voices. [S1] Wow. Amazing. (laughs) [S2] Try it now on Git hub or Hugging Face." +output = model.generate(text) +sf.write("simple.mp3", output, 44100) +``` +上述代码有三个问题 + +1. output的类型是np.int64,不被audio格式支持 + +2. sf.write不支持mp3格式,需要换成wav + +3. 生成的wav文件没有语音 + +目前1,2,问题解决,第三个问题依然存在 ## 依赖