nari-labs/Dia-1.6B 已完整同步
Dia is a 1.6B parameter text to speech model created by Nari Labs. It was pushed to the Hub using the PytorchModelHubMixin integration.
Dia directly generates highly realistic dialogue from a transcript. You can condition the output on audio, enabling emotion and tone control. The model can also produce nonverbal communications like laughter, coughing, clearing throat, etc.
To accelerate research, we are providing access to pretrained model checkpoints and inference code. The model weights are hosted on Hugging Face. The model only supports English generation at the moment.
We also provide a demo page comparing our model to ElevenLabs Studio and Sesame CSM-1B.
- (Update) We have a ZeroGPU Space running! Try it now here. Thanks to the HF team for the support :)
- Join our discord server for community support and access to new features.
- Play with a larger version of Dia: generate fun conversations, remix content, and share with friends. 🔮 Join the waitlist for early access.
⚡️ Quickstart
This will open a Gradio UI that you can work on.
git clone https://github.com/nari-labs/dia.git
cd dia && uv run app.py
or if you do not have uv pre-installed:
git clone https://github.com/nari-labs/dia.git
cd dia
python -m venv .venv
source .venv/bin/activate
pip install uv
uv run app.py
Note that the model was not fine-tuned on a specific voice. Hence, you will get different voices every time you run the model. You can keep speaker consistency by either adding an audio prompt (a guide coming VERY soon - try it with the second example on Gradio for now), or fixing the seed.
Features
- Generate dialogue via
[S1]and[S2]tag - Generate non-verbal like
(laughs),(coughs), etc.- Below verbal tags will be recognized, but might result in unexpected output.
(laughs), (clears throat), (sighs), (gasps), (coughs), (singing), (sings), (mumbles), (beep), (groans), (sniffs), (claps), (screams), (inhales), (exhales), (applause), (burps), (humming), (sneezes), (chuckle), (whistles)
- Voice cloning. See
example/voice_clone.pyfor more information.- In the Hugging Face space, you can upload the audio you want to clone and place its transcript before your script. Make sure the transcript follows the required format. The model will then output only the content of your script.
⚙️ Usage
As a Python Library
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)
A p
6 个文件
浏览文件数据集版权信息
本数据集的许可证为 Apache License 2.0。如有违反相关条款,请联系 WEHUB,我们将及时处理。 查看许可证
通过 WeHub CLI 下载当前数据集快照。下列命令会固定为当前页面展示的数据版本(如果页面提供版本)。文件字节由本机直连存储下载,浏览器不会签发或保存下载链接。
前置要求
需要 Node.js 18 及以上,以及 npm(或 npx)。
1. 安装 CLI
npm install -g wehub-cli@latest
2. 下载此数据集
wehub datasets download ds_ext_4322_5724c5b59e --revision 257bc72f9b78182ccc6fa07675a9ae4c1a44e2cd --output ./ds_ext_4322_5724c5b59e
若中断或部分失败,在同一目录重新执行同一命令即可续传。默认会校验 SHA-256。
免全局安装
npx --yes wehub-cli@latest datasets download ds_ext_4322_5724c5b59e --revision 257bc72f9b78182ccc6fa07675a9ae4c1a44e2cd --output ./ds_ext_4322_5724c5b59e
高级选项
以下为 wehub datasets download 已支持的参数示例:
强制重新下载,不复用已校验的本地文件
wehub datasets download ds_ext_4322_5724c5b59e --revision 257bc72f9b78182ccc6fa07675a9ae4c1a44e2cd --output ./ds_ext_4322_5724c5b59e --overwrite
仅包含匹配路径
wehub datasets download ds_ext_4322_5724c5b59e --revision 257bc72f9b78182ccc6fa07675a9ae4c1a44e2cd --output ./ds_ext_4322_5724c5b59e --include "*.jsonl"
排除匹配路径
wehub datasets download ds_ext_4322_5724c5b59e --revision 257bc72f9b78182ccc6fa07675a9ae4c1a44e2cd --output ./ds_ext_4322_5724c5b59e --exclude "*.md"
提高并发下载数
wehub datasets download ds_ext_4322_5724c5b59e --revision 257bc72f9b78182ccc6fa07675a9ae4c1a44e2cd --output ./ds_ext_4322_5724c5b59e --jobs 8
完整帮助:wehub datasets download --help