reab5555 commited on
Commit
3ec6e9a
·
verified ·
1 Parent(s): 03701cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -28,8 +28,8 @@ def transcribe(video_file, transcribe_to_text, transcribe_to_srt, language):
28
  generate_kwargs={"language": language}
29
  )
30
 
31
- # Handle both file path (str) and file object
32
- video_path = video_file if isinstance(video_file, str) else video_file.name
33
  video = VideoFileClip(video_path)
34
  audio = video.audio
35
  duration = video.duration
@@ -75,7 +75,7 @@ def format_time(seconds):
75
  iface = gr.Interface(
76
  fn=transcribe,
77
  inputs=[
78
- gr.Video(type="filepath"),
79
  gr.Checkbox(label="Transcribe to Text"),
80
  gr.Checkbox(label="Transcribe to SRT"),
81
  gr.Dropdown(choices=['en', 'he', 'it', 'fr', 'de', 'zh', 'ar'], label="Language")
 
28
  generate_kwargs={"language": language}
29
  )
30
 
31
+ # Handle the video file input
32
+ video_path = video_file.name if hasattr(video_file, 'name') else video_file
33
  video = VideoFileClip(video_path)
34
  audio = video.audio
35
  duration = video.duration
 
75
  iface = gr.Interface(
76
  fn=transcribe,
77
  inputs=[
78
+ gr.Video(),
79
  gr.Checkbox(label="Transcribe to Text"),
80
  gr.Checkbox(label="Transcribe to SRT"),
81
  gr.Dropdown(choices=['en', 'he', 'it', 'fr', 'de', 'zh', 'ar'], label="Language")