Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -112,13 +112,13 @@ with gr.Blocks() as blocks_app:
|
|
112 |
output_srt = gr.File(label="Subtitles File (.srt)")
|
113 |
|
114 |
def transcribe_and_add_subtitles(video_file):
|
115 |
-
transcription = transcribe(video_file
|
116 |
srt_path = text_to_srt(transcription)
|
117 |
output_video_path = add_subtitle_to_video(video_file.name, srt_path, subtitle_language="eng", soft_subtitle=False)
|
118 |
return output_video_path, srt_path
|
119 |
|
120 |
def translate_subtitles_and_add_to_video(video_file, source_language_code, target_language_code):
|
121 |
-
transcription = transcribe(video_file
|
122 |
srt_path = text_to_srt(transcription)
|
123 |
translated_srt_path = translate_srt(srt_path, source_language_code, target_language_code)
|
124 |
output_video_path = add_subtitle_to_video(video_file.name, translated_srt_path, target_language_code, soft_subtitle=False)
|
|
|
112 |
output_srt = gr.File(label="Subtitles File (.srt)")
|
113 |
|
114 |
def transcribe_and_add_subtitles(video_file):
|
115 |
+
transcription = transcribe(video_file, "tiny")
|
116 |
srt_path = text_to_srt(transcription)
|
117 |
output_video_path = add_subtitle_to_video(video_file.name, srt_path, subtitle_language="eng", soft_subtitle=False)
|
118 |
return output_video_path, srt_path
|
119 |
|
120 |
def translate_subtitles_and_add_to_video(video_file, source_language_code, target_language_code):
|
121 |
+
transcription = transcribe(video_file, "tiny")
|
122 |
srt_path = text_to_srt(transcription)
|
123 |
translated_srt_path = translate_srt(srt_path, source_language_code, target_language_code)
|
124 |
output_video_path = add_subtitle_to_video(video_file.name, translated_srt_path, target_language_code, soft_subtitle=False)
|