JasonChen0317 commited on
Commit
55a9367
·
1 Parent(s): aa30b16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -122,7 +122,10 @@ def Text_to_Speech(language):
122
  elif language=='Spanish':
123
  to_code = "es"
124
 
125
-
 
 
 
126
  #Create directory
127
  if os.path.exists('TTS'):
128
  shutil.rmtree('TTS')
@@ -166,10 +169,7 @@ def Text_to_Speech(language):
166
  return gr.Audio(value="TTS/TTS.wav"), gr.File(label="TTS Audio File", value="TTS/TTS.wav")
167
 
168
  with gr.Blocks() as demo:
169
- # Get device
170
- device = "cuda" if torch.cuda.is_available() else "cpu"
171
- #Get tts model from TTS
172
- tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
173
  gr.Markdown(
174
  """
175
  # Foreign Whispers
 
122
  elif language=='Spanish':
123
  to_code = "es"
124
 
125
+ # Get device
126
+ device = "cuda" if torch.cuda.is_available() else "cpu"
127
+ #Get tts model from TTS
128
+ tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
129
  #Create directory
130
  if os.path.exists('TTS'):
131
  shutil.rmtree('TTS')
 
169
  return gr.Audio(value="TTS/TTS.wav"), gr.File(label="TTS Audio File", value="TTS/TTS.wav")
170
 
171
  with gr.Blocks() as demo:
172
+
 
 
 
173
  gr.Markdown(
174
  """
175
  # Foreign Whispers