Spaces:
Runtime error
Runtime error
Commit
·
b1f60b9
1
Parent(s):
26b0345
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,8 +87,6 @@ def process_video(radio, video, target_language):
|
|
| 87 |
whisper_text = " ".join(segment.text for segment in segments)
|
| 88 |
whisper_language = info.language
|
| 89 |
print(whisper_text)
|
| 90 |
-
del model
|
| 91 |
-
torch.cuda.empty_cache()
|
| 92 |
|
| 93 |
language_mapping = {'English': 'en', 'Spanish': 'es', 'French': 'fr', 'German': 'de', 'Italian': 'it', 'Portuguese': 'pt', 'Polish': 'pl', 'Turkish': 'tr', 'Russian': 'ru', 'Dutch': 'nl', 'Czech': 'cs', 'Arabic': 'ar', 'Chinese (Simplified)': 'zh-cn'}
|
| 94 |
target_language_code = language_mapping[target_language]
|
|
@@ -103,8 +101,6 @@ def process_video(radio, video, target_language):
|
|
| 103 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v1")
|
| 104 |
tts.to('cuda')
|
| 105 |
tts.tts_to_file(translated_text, speaker_wav=f"{run_uuid}_output_audio_final.wav", file_path=f"{run_uuid}_output_synth.wav", language=target_language_code)
|
| 106 |
-
del tts
|
| 107 |
-
torch.cuda.empty_cache()
|
| 108 |
|
| 109 |
pad_top = 0
|
| 110 |
pad_bottom = 15
|
|
|
|
| 87 |
whisper_text = " ".join(segment.text for segment in segments)
|
| 88 |
whisper_language = info.language
|
| 89 |
print(whisper_text)
|
|
|
|
|
|
|
| 90 |
|
| 91 |
language_mapping = {'English': 'en', 'Spanish': 'es', 'French': 'fr', 'German': 'de', 'Italian': 'it', 'Portuguese': 'pt', 'Polish': 'pl', 'Turkish': 'tr', 'Russian': 'ru', 'Dutch': 'nl', 'Czech': 'cs', 'Arabic': 'ar', 'Chinese (Simplified)': 'zh-cn'}
|
| 92 |
target_language_code = language_mapping[target_language]
|
|
|
|
| 101 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v1")
|
| 102 |
tts.to('cuda')
|
| 103 |
tts.tts_to_file(translated_text, speaker_wav=f"{run_uuid}_output_audio_final.wav", file_path=f"{run_uuid}_output_synth.wav", language=target_language_code)
|
|
|
|
|
|
|
| 104 |
|
| 105 |
pad_top = 0
|
| 106 |
pad_bottom = 15
|