Lenylvt commited on
Commit
3678816
·
verified ·
1 Parent(s): b7a9c79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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.name, "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.name, "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)
 
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)