Spaces:
Running
Running
Yurii Paniv
commited on
Commit
•
4468072
1
Parent(s):
2814fc6
Release v0.0.2
Browse files- app.py +5 -2
- crh_preprocessor/__init__.py +0 -0
- crh_preprocessor/preprocessor.py +16 -5
- crh_transliterator/__init__.py +0 -0
- crh_tts/__init__.py +0 -0
- crh_tts/tts.py +1 -0
- requirements.txt +1 -1
app.py
CHANGED
@@ -12,9 +12,10 @@ from torch.cuda import is_available
|
|
12 |
|
13 |
|
14 |
class VoiceOption(Enum):
|
15 |
-
Nuri = "
|
16 |
Arslan = "Арслан (чоловічий) 👨"
|
17 |
-
Kemal = "
|
|
|
18 |
|
19 |
|
20 |
print(f"CUDA available? {is_available()}")
|
@@ -37,6 +38,7 @@ def tts(text: str, voice: str):
|
|
37 |
VoiceOption.Nuri.value: Voices.Nuri.value,
|
38 |
VoiceOption.Arslan.value: Voices.Arslan.value,
|
39 |
VoiceOption.Kemal.value: Voices.Kemal.value,
|
|
|
40 |
}
|
41 |
|
42 |
speaker_name = voice_mapping[voice]
|
@@ -83,6 +85,7 @@ iface = gr.Interface(
|
|
83 |
VoiceOption.Arslan.value,
|
84 |
],
|
85 |
["Селям! Ишлер насыл?", VoiceOption.Nuri.value],
|
|
|
86 |
],
|
87 |
)
|
88 |
iface.launch()
|
|
|
12 |
|
13 |
|
14 |
class VoiceOption(Enum):
|
15 |
+
Nuri = "Севіль (жіночий) 👩"
|
16 |
Arslan = "Арслан (чоловічий) 👨"
|
17 |
+
Kemal = "Ескандер (чоловічий) 👨"
|
18 |
+
Abibulla = "Абібулла (чоловічий) 👨"
|
19 |
|
20 |
|
21 |
print(f"CUDA available? {is_available()}")
|
|
|
38 |
VoiceOption.Nuri.value: Voices.Nuri.value,
|
39 |
VoiceOption.Arslan.value: Voices.Arslan.value,
|
40 |
VoiceOption.Kemal.value: Voices.Kemal.value,
|
41 |
+
VoiceOption.Abibulla.value: Voices.Abibulla.value,
|
42 |
}
|
43 |
|
44 |
speaker_name = voice_mapping[voice]
|
|
|
85 |
VoiceOption.Arslan.value,
|
86 |
],
|
87 |
["Селям! Ишлер насыл?", VoiceOption.Nuri.value],
|
88 |
+
["Selâm! 123456789", VoiceOption.Abibulla.value],
|
89 |
],
|
90 |
)
|
91 |
iface.launch()
|
crh_preprocessor/__init__.py
DELETED
File without changes
|
crh_preprocessor/preprocessor.py
CHANGED
@@ -1,15 +1,26 @@
|
|
1 |
import re
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
def preprocess(text):
|
8 |
text = text.lower() # always treat lowercase
|
9 |
text = " " + text + " "
|
10 |
|
11 |
-
for
|
12 |
-
text = re.sub(
|
13 |
|
14 |
numbers = {
|
15 |
"0": "sıfır",
|
|
|
1 |
import re
|
2 |
|
3 |
+
mapping = {
|
4 |
+
"n\u0303": "\xf1",
|
5 |
+
"g\u0306": "\u011f",
|
6 |
+
"i\u0307": "i",
|
7 |
+
"u\u0308": "\xfc",
|
8 |
+
"o\u0308": "\xf6",
|
9 |
+
"\xe7": "\u04ab",
|
10 |
+
"c\u0327": "\u04ab",
|
11 |
+
"s\u0327": "\u015f",
|
12 |
+
"a\u0302": "\xe2",
|
13 |
+
"w": "v",
|
14 |
+
"x": "ks"
|
15 |
+
}
|
16 |
+
|
17 |
|
18 |
def preprocess(text):
|
19 |
text = text.lower() # always treat lowercase
|
20 |
text = " " + text + " "
|
21 |
|
22 |
+
for symbol in mapping.keys():
|
23 |
+
text = re.sub(symbol, mapping[symbol], text)
|
24 |
|
25 |
numbers = {
|
26 |
"0": "sıfır",
|
crh_transliterator/__init__.py
DELETED
File without changes
|
crh_tts/__init__.py
DELETED
File without changes
|
crh_tts/tts.py
CHANGED
@@ -13,6 +13,7 @@ class Voices(Enum):
|
|
13 |
Arslan = "arslan"
|
14 |
Nuri = "nuri"
|
15 |
Kemal = "kemal"
|
|
|
16 |
|
17 |
|
18 |
class TTS:
|
|
|
13 |
Arslan = "arslan"
|
14 |
Nuri = "nuri"
|
15 |
Kemal = "kemal"
|
16 |
+
Abibulla = "abibulla"
|
17 |
|
18 |
|
19 |
class TTS:
|
requirements.txt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
gradio==3.6
|
2 |
torch>=1.13
|
3 |
-
TTS==0.
|
|
|
1 |
gradio==3.6
|
2 |
torch>=1.13
|
3 |
+
TTS==0.9.0
|