Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
32 |
-
video_path = video_file if
|
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(
|
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")
|