khof312 commited on
Commit
332bb9f
1 Parent(s): 24c2e60

Fix error handling for Toucan which has been facing bugs.

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -50,7 +50,10 @@ type=['wav'])
50
  base_mms = synth_mms(tts_text, models[tts_lang]['mms'])
51
  base_coqui= synth_coqui(tts_text, models[tts_lang]['coqui'])
52
  base_espeakng= synth_espeakng(tts_text, models[tts_lang]['espeakng'])
53
- base_toucan= synth_toucan(tts_text, models[tts_lang]['toucan'])
 
 
 
54
  base_piper= synth_piper(tts_text, models[tts_lang]['piper'])
55
 
56
  if tts_lang=="swh":
@@ -96,9 +99,10 @@ type=['wav'])
96
  row4[1].write("default")
97
  row4[2].audio(base_espeakng[0], sample_rate = base_espeakng[1])
98
 
99
- row5[0].write(f"[IMS-Toucan](https://github.com/DigitalPhonetics/IMS-Toucan)")
100
- row5[1].write("default")
101
- row5[2].audio(base_toucan[0], sample_rate = base_toucan[1])
 
102
 
103
  if base_piper is not None:
104
  row6[0].write(f"[Piper](https://github.com/rhasspy/piper)")
 
50
  base_mms = synth_mms(tts_text, models[tts_lang]['mms'])
51
  base_coqui= synth_coqui(tts_text, models[tts_lang]['coqui'])
52
  base_espeakng= synth_espeakng(tts_text, models[tts_lang]['espeakng'])
53
+ try:
54
+ base_toucan= synth_toucan(tts_text, models[tts_lang]['toucan'])
55
+ except:
56
+ base_toucan=None
57
  base_piper= synth_piper(tts_text, models[tts_lang]['piper'])
58
 
59
  if tts_lang=="swh":
 
99
  row4[1].write("default")
100
  row4[2].audio(base_espeakng[0], sample_rate = base_espeakng[1])
101
 
102
+ if base_toucan is not None:
103
+ row5[0].write(f"[IMS-Toucan](https://github.com/DigitalPhonetics/IMS-Toucan)")
104
+ row5[1].write("default")
105
+ row5[2].audio(base_toucan[0], sample_rate = base_toucan[1])
106
 
107
  if base_piper is not None:
108
  row6[0].write(f"[Piper](https://github.com/rhasspy/piper)")