Spaces:
Runtime error
Runtime error
artificialguybr
commited on
Commit
β’
58ceda5
1
Parent(s):
6f11b02
Update app.py
Browse files
app.py
CHANGED
@@ -84,12 +84,12 @@ def process_video(radio, video, target_language):
|
|
84 |
subprocess.run([item for item in shell_command], capture_output=False, text=True, check=True)
|
85 |
|
86 |
segments, info = model.transcribe(f"{run_uuid}_output_audio_final.wav", beam_size=5)
|
87 |
-
del model
|
88 |
-
torch.cuda.empty_cache()
|
89 |
whisper_text = " ".join(segment.text for segment in segments)
|
90 |
whisper_language = info.language
|
91 |
print(whisper_text)
|
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]
|
95 |
translator = Translator()
|
|
|
84 |
subprocess.run([item for item in shell_command], capture_output=False, text=True, check=True)
|
85 |
|
86 |
segments, info = model.transcribe(f"{run_uuid}_output_audio_final.wav", beam_size=5)
|
|
|
|
|
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]
|
95 |
translator = Translator()
|