Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,6 +43,7 @@ def process_video(Video, target_language, translate_video):
|
|
| 43 |
transcript_file = f"{current_path}/{common_uuid}.srt"
|
| 44 |
|
| 45 |
# Transcription with Whisper.
|
|
|
|
| 46 |
print("Iniciando transcrição com Whisper")
|
| 47 |
segments, _ = whisper_model.transcribe(audio_file, beam_size=5)
|
| 48 |
segments = list(segments)
|
|
@@ -71,7 +72,6 @@ def process_video(Video, target_language, translate_video):
|
|
| 71 |
# Check if translation is needed
|
| 72 |
if translate_video:
|
| 73 |
# Translating the SRT from Whisper with Google Translate.
|
| 74 |
-
target_language_code = google_lang_codes.get(target_language, "en")
|
| 75 |
translated_lines = []
|
| 76 |
f.seek(0) # Move the file pointer to the beginning of the file.
|
| 77 |
for line in f:
|
|
|
|
| 43 |
transcript_file = f"{current_path}/{common_uuid}.srt"
|
| 44 |
|
| 45 |
# Transcription with Whisper.
|
| 46 |
+
target_language_code = google_lang_codes.get(target_language, "en")
|
| 47 |
print("Iniciando transcrição com Whisper")
|
| 48 |
segments, _ = whisper_model.transcribe(audio_file, beam_size=5)
|
| 49 |
segments = list(segments)
|
|
|
|
| 72 |
# Check if translation is needed
|
| 73 |
if translate_video:
|
| 74 |
# Translating the SRT from Whisper with Google Translate.
|
|
|
|
| 75 |
translated_lines = []
|
| 76 |
f.seek(0) # Move the file pointer to the beginning of the file.
|
| 77 |
for line in f:
|