NariLabs commited on
Commit
ed6eb51
·
verified ·
1 Parent(s): 0c1a01d

Push model using huggingface_hub.

Browse files
Files changed (3) hide show
  1. README.md +7 -120
  2. config.json +47 -43
  3. model.safetensors +3 -0
README.md CHANGED
@@ -1,125 +1,12 @@
1
  ---
2
  license: apache-2.0
3
- language:
4
- - en
5
- tags:
6
- - Text-to-Speech
7
  pipeline_tag: text-to-speech
8
- library_name: dia-tts
 
 
9
  ---
10
- <center>
11
- <a href="https://github.com/nari-labs/dia">
12
- <img src="https://github.com/nari-labs/dia/raw/main/dia/static/images/banner.png">
13
- </a>
14
- </center>
15
-
16
- Dia is a 1.6B parameter text to speech model created by Nari Labs.
17
-
18
- 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.
19
-
20
- To accelerate research, we are providing access to pretrained model checkpoints and inference code. The model weights are hosted on [Hugging Face](https://huggingface.co/nari-labs/Dia-1.6B). The model only supports English generation at the moment.
21
-
22
- We also provide a [demo page](https://yummy-fir-7a4.notion.site/dia) comparing our model to [ElevenLabs Studio](https://elevenlabs.io/studio) and [Sesame CSM-1B](https://github.com/SesameAILabs/csm).
23
-
24
- - (Update) We have a ZeroGPU Space running! Try it now [here](https://huggingface.co/spaces/nari-labs/Dia-1.6B). Thanks to the HF team for the support :)
25
- - Join our [discord server](https://discord.gg/pgdB5YRe) for community support and access to new features.
26
- - Play with a larger version of Dia: generate fun conversations, remix content, and share with friends. 🔮 Join the [waitlist](https://tally.so/r/meokbo) for early access.
27
-
28
- ## ⚡️ Quickstart
29
-
30
- This will open a Gradio UI that you can work on.
31
-
32
- ```bash
33
- git clone https://github.com/nari-labs/dia.git
34
- cd dia && uv run app.py
35
- ```
36
-
37
- or if you do not have `uv` pre-installed:
38
-
39
- ```bash
40
- git clone https://github.com/nari-labs/dia.git
41
- cd dia
42
- python -m venv .venv
43
- source .venv/bin/activate
44
- pip install uv
45
- uv run app.py
46
- ```
47
-
48
- Note that the model was not fine-tuned on a specific voice. Hence, you will get different voices every time you run the model.
49
- 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.
50
-
51
- ## Features
52
-
53
- - Generate dialogue via `[S1]` and `[S2]` tag
54
- - Generate non-verbal like `(laughs)`, `(coughs)`, etc.
55
- - Below verbal tags will be recognized, but might result in unexpected output.
56
- - `(laughs), (clears throat), (sighs), (gasps), (coughs), (singing), (sings), (mumbles), (beep), (groans), (sniffs), (claps), (screams), (inhales), (exhales), (applause), (burps), (humming), (sneezes), (chuckle), (whistles)`
57
- - Voice cloning. See [`example/voice_clone.py`](example/voice_clone.py) for more information.
58
- - 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.
59
-
60
- ## ⚙️ Usage
61
-
62
- ### As a Python Library
63
-
64
- ```python
65
- import soundfile as sf
66
-
67
- from dia.model import Dia
68
-
69
-
70
- model = Dia.from_pretrained("nari-labs/Dia-1.6B")
71
-
72
- 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."
73
-
74
- output = model.generate(text)
75
-
76
- sf.write("simple.mp3", output, 44100)
77
- ```
78
-
79
- A pypi package and a working CLI tool will be available soon.
80
-
81
- ## 💻 Hardware and Inference Speed
82
-
83
- Dia has been tested on only GPUs (pytorch 2.0+, CUDA 12.6). CPU support is to be added soon.
84
- The initial run will take longer as the Descript Audio Codec also needs to be downloaded.
85
-
86
- On enterprise GPUs, Dia can generate audio in real-time. On older GPUs, inference time will be slower.
87
- For reference, on a A4000 GPU, Dia roughly generates 40 tokens/s (86 tokens equals 1 second of audio).
88
- `torch.compile` will increase speeds for supported GPUs.
89
-
90
- The full version of Dia requires around 10GB of VRAM to run. We will be adding a quantized version in the future.
91
-
92
- If you don't have hardware available or if you want to play with bigger versions of our models, join the waitlist [here](https://tally.so/r/meokbo).
93
-
94
- ## 🪪 License
95
-
96
- This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
97
-
98
- ## ⚠️ Disclaimer
99
-
100
- This project offers a high-fidelity speech generation model intended for research and educational use. The following uses are **strictly forbidden**:
101
-
102
- - **Identity Misuse**: Do not produce audio resembling real individuals without permission.
103
- - **Deceptive Content**: Do not use this model to generate misleading content (e.g. fake news)
104
- - **Illegal or Malicious Use**: Do not use this model for activities that are illegal or intended to cause harm.
105
-
106
- By using this model, you agree to uphold relevant legal standards and ethical responsibilities. We **are not responsible** for any misuse and firmly oppose any unethical usage of this technology.
107
-
108
- ## 🔭 TODO / Future Work
109
-
110
- - Docker support.
111
- - Optimize inference speed.
112
- - Add quantization for memory efficiency.
113
-
114
- ## 🤝 Contributing
115
-
116
- We are a tiny team of 1 full-time and 1 part-time research-engineers. We are extra-welcome to any contributions!
117
- Join our [Discord Server](https://discord.gg/pgdB5YRe) for discussions.
118
-
119
- ## 🤗 Acknowledgements
120
 
121
- - We thank the [Google TPU Research Cloud program](https://sites.research.google/trc/about/) for providing computation resources.
122
- - Our work was heavily inspired by [SoundStorm](https://arxiv.org/abs/2305.09636), [Parakeet](https://jordandarefsky.com/blog/2024/parakeet/), and [Descript Audio Codec](https://github.com/descriptinc/descript-audio-codec).
123
- - HuggingFace for providing the ZeroGPU Grant.
124
- - "Nari" is a pure Korean word for lily.
125
- - We thank Jason Y. for providing help with data filtering.
 
1
  ---
2
  license: apache-2.0
 
 
 
 
3
  pipeline_tag: text-to-speech
4
+ tags:
5
+ - model_hub_mixin
6
+ - pytorch_model_hub_mixin
7
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ This model has been pushed to the Hub using the [PytorchModelHubMixin](https://huggingface.co/docs/huggingface_hub/package_reference/mixins#huggingface_hub.PyTorchModelHubMixin) integration:
10
+ - Code: https://github.com/nari-labs/dia
11
+ - Paper: [More Information Needed]
12
+ - Docs: [More Information Needed]
 
config.json CHANGED
@@ -1,46 +1,50 @@
1
  {
2
- "version": "0.1",
3
- "model": {
4
- "encoder": {
5
- "n_layer": 12,
6
- "n_embd": 1024,
7
- "n_hidden": 4096,
8
- "n_head": 16,
9
- "head_dim": 128
10
- },
11
- "decoder": {
12
- "n_layer": 18,
13
- "n_embd": 2048,
14
- "n_hidden": 8192,
15
- "gqa_query_heads": 16,
16
- "cross_query_heads": 16,
17
- "kv_heads": 4,
18
- "gqa_head_dim": 128,
19
- "cross_head_dim": 128
20
- },
21
- "src_vocab_size": 256,
22
- "tgt_vocab_size": 1028,
23
- "dropout": 0.0
 
 
 
 
 
 
 
 
24
  },
25
- "training": {},
26
- "data": {
27
- "text_length": 1024,
28
- "audio_length": 3072,
29
- "channels": 9,
30
- "text_pad_value": 0,
31
- "audio_eos_value": 1024,
32
- "audio_pad_value": 1025,
33
- "audio_bos_value": 1026,
34
- "delay_pattern": [
35
- 0,
36
- 8,
37
- 9,
38
- 10,
39
- 11,
40
- 12,
41
- 13,
42
- 14,
43
- 15
44
- ]
45
- }
46
  }
 
1
  {
2
+ "data": {
3
+ "audio_bos_value": 1026,
4
+ "audio_eos_value": 1024,
5
+ "audio_length": 3072,
6
+ "audio_pad_value": 1025,
7
+ "channels": 9,
8
+ "delay_pattern": [
9
+ 0,
10
+ 8,
11
+ 9,
12
+ 10,
13
+ 11,
14
+ 12,
15
+ 13,
16
+ 14,
17
+ 15
18
+ ],
19
+ "text_length": 1024,
20
+ "text_pad_value": 0
21
+ },
22
+ "model": {
23
+ "decoder": {
24
+ "cross_head_dim": 128,
25
+ "cross_query_heads": 16,
26
+ "gqa_head_dim": 128,
27
+ "gqa_query_heads": 16,
28
+ "kv_heads": 4,
29
+ "n_embd": 2048,
30
+ "n_hidden": 8192,
31
+ "n_layer": 18
32
  },
33
+ "dropout": 0.0,
34
+ "encoder": {
35
+ "head_dim": 128,
36
+ "n_embd": 1024,
37
+ "n_head": 16,
38
+ "n_hidden": 4096,
39
+ "n_layer": 12
40
+ },
41
+ "normalization_layer_epsilon": 1e-05,
42
+ "rope_max_timescale": 10000,
43
+ "rope_min_timescale": 1,
44
+ "src_vocab_size": 256,
45
+ "tgt_vocab_size": 1028,
46
+ "weight_dtype": "float32"
47
+ },
48
+ "training": {},
49
+ "version": "0.1"
 
 
 
 
50
  }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:caba289b60f6d7d1e58fc744f4dc25aae88995fcca46be3d05e220b971486a26
3
+ size 6444682848