younes21000 commited on
Commit
b2110ff
1 Parent(s): 3a2791b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -3
app.py CHANGED
@@ -210,9 +210,27 @@ def transcribe_video(video_file, video_url, language, target_language, output_fo
210
  write_ppt(result, ppt_file, tokenizer, translation_model)
211
  return ppt_file
212
 
213
- # Gradio interface without YouTube
214
  iface = gr.Interface(
215
  fn=transcribe_video,
216
  inputs=[
217
- gr.File(label="Upload Video File"), # Removed YouTube URL input
218
- gr.Dropdown(label="Select Original Video Language", choices
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  write_ppt(result, ppt_file, tokenizer, translation_model)
211
  return ppt_file
212
 
213
+ # Gradio interface with YouTube URL
214
  iface = gr.Interface(
215
  fn=transcribe_video,
216
  inputs=[
217
+ gr.File(label="Upload Video File (or leave empty for YouTube link)"),
218
+ gr.Textbox(label="YouTube Video URL (optional)", placeholder="https://www.youtube.com/watch?v=..."),
219
+ gr.Dropdown(label="Select Original Video Language", choices=["en", "es", "fr", "de", "it", "pt"], value="en"),
220
+ gr.Dropdown(label="Select Subtitle Translation Language", choices=["en", "fa", "es", "de", "fr", "it", "pt"], value="fa"),
221
+ gr.Radio(label="Choose Output Format", choices=["SRT", "Video with Hardsub", "Word", "PDF", "PowerPoint"], value="Video with Hardsub")
222
+ ],
223
+ outputs=gr.File(label="Download File"),
224
+ title="Video Subtitle Generator with Translation & Multi-Format Output (Supports YouTube)",
225
+ description=(
226
+ "This tool allows you to generate subtitles from a video file or YouTube link using Whisper, "
227
+ "translate the subtitles into multiple languages using M2M100, and export them "
228
+ "in various formats including SRT, hardcoded subtitles in video, Word, PDF, or PowerPoint."
229
+ ),
230
+ theme="compact",
231
+ live=False
232
+ )
233
+
234
+ if __name__ == "__main__":
235
+ iface.launch()
236
+