Abrahamau commited on
Commit
8392bfa
·
verified ·
1 Parent(s): d20b560

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -28,9 +28,11 @@ def guessanAge(model, image):
28
  @spaces.GPU(duration=120)
29
  def text2speech(text, no, sample):
30
  os.environ["COQUI_TOS_AGREED"] = "1"
 
 
31
  if len(text) > 0:
32
  tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
33
- wav = tts.tts_to_file(text=text, file_path="output.wav", speaker_wav="sampleaudio/abraham.wav", language="en")
34
  return wav
35
 
36
  @spaces.GPU
 
28
  @spaces.GPU(duration=120)
29
  def text2speech(text, no, sample):
30
  os.environ["COQUI_TOS_AGREED"] = "1"
31
+ if sample is None:
32
+ sample = "sampleaudio/abraham.wav"
33
  if len(text) > 0:
34
  tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
35
+ wav = tts.tts_to_file(text=text, file_path="output.wav", speaker_wav=sample, language="en")
36
  return wav
37
 
38
  @spaces.GPU