Update README.md
Browse files
README.md
CHANGED
@@ -22,6 +22,37 @@ Maximum relative tensor difference: 0.229572
|
|
22 |
Average absolute tensor difference: 0.000010
|
23 |
```
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
<center>
|
26 |
<a href="https://github.com/nari-labs/dia">
|
27 |
<img src="https://github.com/nari-labs/dia/raw/main/dia/static/images/banner.png">
|
@@ -80,7 +111,7 @@ import soundfile as sf
|
|
80 |
from dia.model import Dia
|
81 |
|
82 |
|
83 |
-
model = Dia.from_pretrained("
|
84 |
|
85 |
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."
|
86 |
|
|
|
22 |
Average absolute tensor difference: 0.000010
|
23 |
```
|
24 |
|
25 |
+
To use the safetensors file, use this custom script which allows loading from safetensors:
|
26 |
+
|
27 |
+
First install the library:
|
28 |
+
```
|
29 |
+
git clone https://github.com/thepushkarp/dia.git
|
30 |
+
cd dia
|
31 |
+
python -m venv .venv
|
32 |
+
source .venv/bin/activate
|
33 |
+
```
|
34 |
+
|
35 |
+
Then run:
|
36 |
+
```
|
37 |
+
import soundfile as sf
|
38 |
+
|
39 |
+
from dia.model import Dia
|
40 |
+
|
41 |
+
|
42 |
+
model = Dia.from_pretrained(
|
43 |
+
"thepushkarp/Dia-1.6B-safetensors-fp16",
|
44 |
+
config_path="config.json",
|
45 |
+
checkpoint_path="dia-v0_1-fp16.safetensors",
|
46 |
+
)
|
47 |
+
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."
|
48 |
+
|
49 |
+
output = model.generate(text)
|
50 |
+
|
51 |
+
sf.write("simple.mp3", output, 44100)
|
52 |
+
```
|
53 |
+
|
54 |
+
---
|
55 |
+
|
56 |
<center>
|
57 |
<a href="https://github.com/nari-labs/dia">
|
58 |
<img src="https://github.com/nari-labs/dia/raw/main/dia/static/images/banner.png">
|
|
|
111 |
from dia.model import Dia
|
112 |
|
113 |
|
114 |
+
model = Dia.from_pretrained("nari-labs/Dia-1.6B")
|
115 |
|
116 |
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."
|
117 |
|