jhlfrfufyfn commited on
Commit
3b4975a
โ€ข
1 Parent(s): f745733

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -17,7 +17,22 @@ my_inputs = [
17
 
18
  my_outputs = gr.outputs.Audio(type="file", label="Output Audio")
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  def tts(text: str):
 
21
  best_model_path = hf_hub_download(repo_id=REPO_ID, filename="model.pth")
22
  config_path = hf_hub_download(repo_id=REPO_ID, filename="config.json")
23
  vocoder_path = hf_hub_download(repo_id=REPO_ID, filename="vocoder.pth")
 
17
 
18
  my_outputs = gr.outputs.Audio(type="file", label="Output Audio")
19
 
20
+ def belarusify_russian_text(text: str):
21
+ text = text.replace("ะธ", "ั–")
22
+ text = text.replace("ั–ัƒ", "ั–ัž")
23
+ text = text.replace("ะพัƒ", "ะพัž")
24
+ text = text.replace("ะฐัƒ", "ะฐัž")
25
+ text = text.replace("ั‹ัƒ", "ั‹ัž")
26
+ text = text.replace("ัƒัƒ", "ัƒัž")
27
+ text = text.replace("ัŽัƒ", "ัŽัž")
28
+ text = text.replace("ะตัƒ", "ะตัž")
29
+ text = text.replace("ั‘ัƒ", "ั‘ัž")
30
+ text = text.replace("ั‰", "ัˆั‡")
31
+ return text
32
+
33
+
34
  def tts(text: str):
35
+ text = belarusify_russian_text(text)
36
  best_model_path = hf_hub_download(repo_id=REPO_ID, filename="model.pth")
37
  config_path = hf_hub_download(repo_id=REPO_ID, filename="config.json")
38
  vocoder_path = hf_hub_download(repo_id=REPO_ID, filename="vocoder.pth")