Spaces:
Running
on
Zero
Running
on
Zero
Serhiy Stetskovych
commited on
Commit
·
9fc6fbc
1
Parent(s):
c1ee666
Fix custom stresses.
Browse files
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)
|