csukuangfj
commited on
Commit
•
2d99181
1
Parent(s):
f1a06f1
update
Browse files- CMU-in-IPA.zip +0 -3
- en_US-amy-medium.onnx +2 -2
- lexicon.txt +0 -3
- tokens.txt +0 -154
- vits-piper-en_US.py +67 -0
- vits-piper-en_US.sh +21 -0
CMU-in-IPA.zip
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:8235d0aef35db62bdcf6a701fb91ec17b02ab72223b27aaea53476488cdae7fe
|
3 |
-
size 879147
|
|
|
|
|
|
|
|
en_US-amy-medium.onnx
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fbaa8e36d8f26fe6f3ebb65cab461e629d8b37a5b7c5fb78fb64317db73e1c25
|
3 |
+
size 63201425
|
lexicon.txt
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b2d66e0ac92e0003805047814a220ef9592b527b99806e5e1a3745dc436d70c6
|
3 |
-
size 36727361
|
|
|
|
|
|
|
|
tokens.txt
DELETED
@@ -1,154 +0,0 @@
|
|
1 |
-
_ 0
|
2 |
-
^ 1
|
3 |
-
$ 2
|
4 |
-
3
|
5 |
-
! 4
|
6 |
-
' 5
|
7 |
-
( 6
|
8 |
-
) 7
|
9 |
-
, 8
|
10 |
-
- 9
|
11 |
-
. 10
|
12 |
-
: 11
|
13 |
-
; 12
|
14 |
-
? 13
|
15 |
-
a 14
|
16 |
-
b 15
|
17 |
-
c 16
|
18 |
-
d 17
|
19 |
-
e 18
|
20 |
-
f 19
|
21 |
-
h 20
|
22 |
-
i 21
|
23 |
-
j 22
|
24 |
-
k 23
|
25 |
-
l 24
|
26 |
-
m 25
|
27 |
-
n 26
|
28 |
-
o 27
|
29 |
-
p 28
|
30 |
-
q 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 100
|
102 |
-
ʋ 101
|
103 |
-
ʌ 102
|
104 |
-
ʍ 103
|
105 |
-
ʎ 104
|
106 |
-
ʏ 105
|
107 |
-
ʐ 106
|
108 |
-
ʑ 107
|
109 |
-
ʒ 108
|
110 |
-
ʔ 109
|
111 |
-
ʕ 110
|
112 |
-
ʘ 111
|
113 |
-
ʙ 112
|
114 |
-
ʛ 113
|
115 |
-
ʜ 114
|
116 |
-
ʝ 115
|
117 |
-
ʟ 116
|
118 |
-
ʡ 117
|
119 |
-
ʢ 118
|
120 |
-
ʲ 119
|
121 |
-
ˈ 120
|
122 |
-
ˌ 121
|
123 |
-
ː 122
|
124 |
-
ˑ 123
|
125 |
-
˞ 124
|
126 |
-
β 125
|
127 |
-
θ 126
|
128 |
-
χ 127
|
129 |
-
ᵻ 128
|
130 |
-
ⱱ 129
|
131 |
-
0 130
|
132 |
-
1 131
|
133 |
-
2 132
|
134 |
-
3 133
|
135 |
-
4 134
|
136 |
-
5 135
|
137 |
-
6 136
|
138 |
-
7 137
|
139 |
-
8 138
|
140 |
-
9 139
|
141 |
-
̧ 140
|
142 |
-
̃ 141
|
143 |
-
̪ 142
|
144 |
-
̯ 143
|
145 |
-
̩ 144
|
146 |
-
ʰ 145
|
147 |
-
ˤ 146
|
148 |
-
ε 147
|
149 |
-
↓ 148
|
150 |
-
# 149
|
151 |
-
" 150
|
152 |
-
↑ 151
|
153 |
-
̺ 152
|
154 |
-
̻ 153
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vits-piper-en_US.py
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python3
|
2 |
+
|
3 |
+
import json
|
4 |
+
import os
|
5 |
+
import re
|
6 |
+
from typing import Any, Dict
|
7 |
+
|
8 |
+
import onnx
|
9 |
+
|
10 |
+
|
11 |
+
def add_meta_data(filename: str, meta_data: Dict[str, Any]):
|
12 |
+
"""Add meta data to an ONNX model. It is changed in-place.
|
13 |
+
|
14 |
+
Args:
|
15 |
+
filename:
|
16 |
+
Filename of the ONNX model to be changed.
|
17 |
+
meta_data:
|
18 |
+
Key-value pairs.
|
19 |
+
"""
|
20 |
+
model = onnx.load(filename)
|
21 |
+
for key, value in meta_data.items():
|
22 |
+
meta = model.metadata_props.add()
|
23 |
+
meta.key = key
|
24 |
+
meta.value = str(value)
|
25 |
+
|
26 |
+
onnx.save(model, filename)
|
27 |
+
|
28 |
+
|
29 |
+
def load_config(model):
|
30 |
+
with open(f"{model}.json", "r") as file:
|
31 |
+
config = json.load(file)
|
32 |
+
return config
|
33 |
+
|
34 |
+
|
35 |
+
# for en_US-lessac-medium.onnx
|
36 |
+
# export TYPE=lessac
|
37 |
+
# export NAME=medium
|
38 |
+
def main():
|
39 |
+
t = os.environ.get("TYPE", None)
|
40 |
+
if not t:
|
41 |
+
print("Please provide the environment variable TYPE")
|
42 |
+
return
|
43 |
+
|
44 |
+
# thorsten or thorsten_emotional
|
45 |
+
name = os.environ.get("NAME", None)
|
46 |
+
if not t:
|
47 |
+
print("Please provide the environment variable NAME")
|
48 |
+
return
|
49 |
+
print("type", t)
|
50 |
+
|
51 |
+
config = load_config(f"en_US-{name}-{t}.onnx")
|
52 |
+
|
53 |
+
print("add model metadata")
|
54 |
+
meta_data = {
|
55 |
+
"model_type": "vits",
|
56 |
+
"comment": "piper", # must be piper for models from piper
|
57 |
+
"language": "English",
|
58 |
+
"voice": config["espeak"]["voice"], # e.g., en-us
|
59 |
+
"has_espeak": int("espeak" in config),
|
60 |
+
"n_speakers": config["num_speakers"],
|
61 |
+
"sample_rate": config["audio"]["sample_rate"],
|
62 |
+
}
|
63 |
+
print(meta_data)
|
64 |
+
add_meta_data(f"en_US-{name}-{t}.onnx", meta_data)
|
65 |
+
|
66 |
+
|
67 |
+
main()
|
vits-piper-en_US.sh
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env bash
|
2 |
+
|
3 |
+
name=$NAME
|
4 |
+
echo "name: $name"
|
5 |
+
|
6 |
+
type=$TYPE
|
7 |
+
echo "type: $type"
|
8 |
+
|
9 |
+
set -ex
|
10 |
+
|
11 |
+
# for en_US-lessac-medium.onnx
|
12 |
+
# export TYPE=lessac
|
13 |
+
# export NAME=medium
|
14 |
+
|
15 |
+
wget -qq https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/$name/$type/en_US-$name-$type.onnx
|
16 |
+
wget -qq https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/$name/$type/en_US-$name-$type.onnx.json
|
17 |
+
wget -qq https://huggingface.co/rhasspy/piper-voices/resolve/main/en/en_US/$name/$type/MODEL_CARD
|
18 |
+
|
19 |
+
pip install piper-phonemize onnx onnxruntime==1.16.0
|
20 |
+
|
21 |
+
python3 ./vits-piper-en_US.py
|