Update app.py
Browse files
app.py
CHANGED
|
@@ -31,9 +31,9 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 31 |
# Function to generate audio
|
| 32 |
def generate_audio(text, language_code):
|
| 33 |
model_name = f"tts_models/{language_code}/fairseq/vits"
|
| 34 |
-
tts = TTS(model_name=model_name, progress_bar=True
|
| 35 |
output_path = "output_file.wav"
|
| 36 |
-
tts.tts_to_file(text=text, file_path=output_path)
|
| 37 |
return output_path
|
| 38 |
|
| 39 |
# Function to filter languages based on search term
|
|
|
|
| 31 |
# Function to generate audio
|
| 32 |
def generate_audio(text, language_code):
|
| 33 |
model_name = f"tts_models/{language_code}/fairseq/vits"
|
| 34 |
+
tts = TTS(model_name=model_name, progress_bar=True).to(device)
|
| 35 |
output_path = "output_file.wav"
|
| 36 |
+
tts.tts_to_file(text=text, file_path=output_path, enable_text_splitting=True, progress_bar=True)
|
| 37 |
return output_path
|
| 38 |
|
| 39 |
# Function to filter languages based on search term
|