Yurii Paniv commited on
Commit
f5aefe9
1 Parent(s): b16fe5e

Fix voices

Browse files
Files changed (3) hide show
  1. app.py +7 -7
  2. crh_preprocessor/preprocessor.py +4 -0
  3. crh_tts/tts.py +1 -1
app.py CHANGED
@@ -14,7 +14,7 @@ from torch.cuda import is_available
14
  class VoiceOption(Enum):
15
  Sevil = "Севіль (жіночий) 👩"
16
  #Arslan = "Арслан (чоловічий) 👨"
17
- Eskandar = "Ескандер (чоловічий) 👨"
18
  # Abibulla = "Абібулла (чоловічий) 👨"
19
 
20
 
@@ -37,7 +37,7 @@ def tts(text: str, voice: str):
37
  voice_mapping = {
38
  VoiceOption.Sevil.value: Voices.Sevil.value,
39
  #VoiceOption.Arslan.value: Voices.Arslan.value,
40
- VoiceOption.Eskandar.value: Voices.Eskandar.value,
41
  #VoiceOption.Abibulla.value: Voices.Abibulla.value,
42
  }
43
 
@@ -68,7 +68,7 @@ iface = gr.Interface(
68
  gr.components.Radio(
69
  label="Голос",
70
  choices=[option.value for option in VoiceOption],
71
- value=VoiceOption.Nuri.value,
72
  ),
73
  ],
74
  outputs=[
@@ -79,13 +79,13 @@ iface = gr.Interface(
79
  description="Кримськотатарський Text-to-Speech за допомогою Coqui TTS",
80
  article=article + f'\n <center><img src="{badge}" alt="visitors badge"/></center>',
81
  examples=[
82
- ["Selâm! İşler nasıl?", VoiceOption.Kemal.value],
83
  [
84
  "Qırımtatarlar üç subetnik gruppasından er birisiniñ (tatlar, noğaylar ve yalıboylular) öz şivesi bar.",
85
- VoiceOption.Nuri.value,
86
  ],
87
- ["Селям! Ишлер насыл?", VoiceOption.Nuri.value],
88
- ["Selâm! 123456789", VoiceOption.Kemal.value],
89
  ],
90
  )
91
  iface.launch()
 
14
  class VoiceOption(Enum):
15
  Sevil = "Севіль (жіночий) 👩"
16
  #Arslan = "Арслан (чоловічий) 👨"
17
+ Eskander = "Ескандер (чоловічий) 👨"
18
  # Abibulla = "Абібулла (чоловічий) 👨"
19
 
20
 
 
37
  voice_mapping = {
38
  VoiceOption.Sevil.value: Voices.Sevil.value,
39
  #VoiceOption.Arslan.value: Voices.Arslan.value,
40
+ VoiceOption.Eskander.value: Voices.Eskander.value,
41
  #VoiceOption.Abibulla.value: Voices.Abibulla.value,
42
  }
43
 
 
68
  gr.components.Radio(
69
  label="Голос",
70
  choices=[option.value for option in VoiceOption],
71
+ value=VoiceOption.Sevil.value,
72
  ),
73
  ],
74
  outputs=[
 
79
  description="Кримськотатарський Text-to-Speech за допомогою Coqui TTS",
80
  article=article + f'\n <center><img src="{badge}" alt="visitors badge"/></center>',
81
  examples=[
82
+ ["Selâm! İşler nasıl?", VoiceOption.Eskander.value],
83
  [
84
  "Qırımtatarlar üç subetnik gruppasından er birisiniñ (tatlar, noğaylar ve yalıboylular) öz şivesi bar.",
85
+ VoiceOption.Sevil.value,
86
  ],
87
+ ["Селям! Ишлер насыл?", VoiceOption.Sevil.value],
88
+ ["Selâm! 123456789", VoiceOption.Eskander.value],
89
  ],
90
  )
91
  iface.launch()
crh_preprocessor/preprocessor.py CHANGED
@@ -22,6 +22,10 @@ def preprocess(text):
22
  for symbol in mapping.keys():
23
  text = re.sub(symbol, mapping[symbol], text)
24
 
 
 
 
 
25
  numbers = {
26
  "0": "sıfır",
27
  "1": "bir",
 
22
  for symbol in mapping.keys():
23
  text = re.sub(symbol, mapping[symbol], text)
24
 
25
+ separators = "?!" # TODO: add proper symbols to tts
26
+ for symbol in separators:
27
+ text = text.replace(symbol, ".")
28
+
29
  numbers = {
30
  "0": "sıfır",
31
  "1": "bir",
crh_tts/tts.py CHANGED
@@ -12,7 +12,7 @@ class Voices(Enum):
12
 
13
  #Arslan = "arslan"
14
  Sevil = "sevil"
15
- Eskandar = "eskandar"
16
  #Abibulla = "abibulla"
17
 
18
 
 
12
 
13
  #Arslan = "arslan"
14
  Sevil = "sevil"
15
+ Eskander = "eskander"
16
  #Abibulla = "abibulla"
17
 
18