Serhiy Stetskovych commited on
Commit
9fc6fbc
·
1 Parent(s): c1ee666

Fix custom stresses.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,7 +10,7 @@ import torch
10
  from ipa_uk import ipa
11
  from unicodedata import normalize
12
  from styletts2_inference.models import StyleTTS2
13
- from ukrainian_word_stress import Stressifier
14
  stressify = Stressifier()
15
 
16
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
@@ -106,7 +106,7 @@ def synthesize(model_name, text, speed, voice_name = None, progress=gr.Progress(
106
  t = t.strip()
107
  t = t.replace('"', '')
108
  if t:
109
- t = t.replace('+', 'ˈ')
110
  t = normalize('NFKC', t)
111
 
112
  t = re.sub(r'[᠆‐‑‒–—―⁻₋−⸺⸻]', '-', t)
 
10
  from ipa_uk import ipa
11
  from unicodedata import normalize
12
  from styletts2_inference.models import StyleTTS2
13
+ from ukrainian_word_stress import Stressifier, StressSymbol
14
  stressify = Stressifier()
15
 
16
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
 
106
  t = t.strip()
107
  t = t.replace('"', '')
108
  if t:
109
+ t = t.replace('+', StressSymbol.CombiningAcuteAccent)
110
  t = normalize('NFKC', t)
111
 
112
  t = re.sub(r'[᠆‐‑‒–—―⁻₋−⸺⸻]', '-', t)