Spaces:
Running
Running
Guenter Bartsch
commited on
Commit
·
f099617
1
Parent(s):
9d808f7
update language via property to avoid model reload
Browse files- app.py +6 -3
- requirements.txt +1 -1
app.py
CHANGED
@@ -6,7 +6,6 @@ from zerovox.tts.synthesize import ZeroVoxTTS
|
|
6 |
from zerovox.g2p.g2p import DEFAULT_G2P_MODEL_NAME_DE, DEFAULT_G2P_MODEL_NAME_EN
|
7 |
|
8 |
SAMPLE_RATE=24000 # FIXME
|
9 |
-
TTS_MODEL_NAME='tts_en_de_zerovox_alpha1'
|
10 |
|
11 |
if "text" not in st.session_state:
|
12 |
st.session_state.text = "Welcome to the world of speech synthesis!"
|
@@ -34,8 +33,12 @@ def do_synth():
|
|
34 |
if 'synth' in st.session_state:
|
35 |
synth = st.session_state.synth
|
36 |
|
37 |
-
if synth.
|
38 |
synth = None # trigger reload
|
|
|
|
|
|
|
|
|
39 |
|
40 |
if not synth:
|
41 |
|
@@ -43,7 +46,7 @@ def do_synth():
|
|
43 |
|
44 |
g2p_model = DEFAULT_G2P_MODEL_NAME_DE if lang=='de' else DEFAULT_G2P_MODEL_NAME_EN
|
45 |
|
46 |
-
st.session_state.modelcfg, st.session_state.synth = ZeroVoxTTS.load_model(
|
47 |
g2p=g2p_model,
|
48 |
lang=lang,
|
49 |
meldec_model=st.session_state['meldec'],
|
|
|
6 |
from zerovox.g2p.g2p import DEFAULT_G2P_MODEL_NAME_DE, DEFAULT_G2P_MODEL_NAME_EN
|
7 |
|
8 |
SAMPLE_RATE=24000 # FIXME
|
|
|
9 |
|
10 |
if "text" not in st.session_state:
|
11 |
st.session_state.text = "Welcome to the world of speech synthesis!"
|
|
|
33 |
if 'synth' in st.session_state:
|
34 |
synth = st.session_state.synth
|
35 |
|
36 |
+
if synth.meldec_model != st.session_state['meldec']:
|
37 |
synth = None # trigger reload
|
38 |
+
else:
|
39 |
+
if synth.language != lang:
|
40 |
+
status.update(label=f"loading the lexicon for {lang} ...", state="running")
|
41 |
+
synth.language = lang
|
42 |
|
43 |
if not synth:
|
44 |
|
|
|
46 |
|
47 |
g2p_model = DEFAULT_G2P_MODEL_NAME_DE if lang=='de' else DEFAULT_G2P_MODEL_NAME_EN
|
48 |
|
49 |
+
st.session_state.modelcfg, st.session_state.synth = ZeroVoxTTS.load_model(ZeroVoxTTS.get_default_model(),
|
50 |
g2p=g2p_model,
|
51 |
lang=lang,
|
52 |
meldec_model=st.session_state['meldec'],
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
zerovox>=0.0.
|
|
|
1 |
+
zerovox>=0.0.15
|