Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from config import openai_api_key
|
|
10 |
llm = load_model(openai_api_key)
|
11 |
|
12 |
|
13 |
-
def analyze_video(video_path,
|
14 |
start_time = time.time()
|
15 |
if not video_path:
|
16 |
return [gr.Markdown("Please upload a video file.")] + [gr.update(visible=False)] * 49 + [
|
@@ -18,7 +18,7 @@ def analyze_video(video_path, language, progress=gr.Progress()):
|
|
18 |
|
19 |
progress(0, desc="Starting analysis...")
|
20 |
progress(0.2, desc="Starting transcription and diarization")
|
21 |
-
transcription = diarize_audio(video_path
|
22 |
print("Transcription:", transcription) # Debug print
|
23 |
progress(0.5, desc="Transcription and diarization complete.")
|
24 |
|
@@ -74,11 +74,6 @@ with gr.Blocks() as iface:
|
|
74 |
gr.Markdown("Upload a video")
|
75 |
|
76 |
video_input = gr.Video(label="Upload Video")
|
77 |
-
language_dropdown = gr.Dropdown(
|
78 |
-
choices=["English", "Hebrew", "Arabic", "French", "German", "Italian", "Japanese", "Chinese", "Auto-detect"],
|
79 |
-
value="English",
|
80 |
-
label="Transcription Language"
|
81 |
-
)
|
82 |
analyze_button = gr.Button("Analyze")
|
83 |
|
84 |
# Create output components
|
@@ -106,7 +101,7 @@ with gr.Blocks() as iface:
|
|
106 |
|
107 |
analyze_button.click(
|
108 |
fn=analyze_video,
|
109 |
-
inputs=[video_input
|
110 |
outputs=output_components,
|
111 |
show_progress=True
|
112 |
)
|
|
|
10 |
llm = load_model(openai_api_key)
|
11 |
|
12 |
|
13 |
+
def analyze_video(video_path, progress=gr.Progress()):
|
14 |
start_time = time.time()
|
15 |
if not video_path:
|
16 |
return [gr.Markdown("Please upload a video file.")] + [gr.update(visible=False)] * 49 + [
|
|
|
18 |
|
19 |
progress(0, desc="Starting analysis...")
|
20 |
progress(0.2, desc="Starting transcription and diarization")
|
21 |
+
transcription = diarize_audio(video_path)
|
22 |
print("Transcription:", transcription) # Debug print
|
23 |
progress(0.5, desc="Transcription and diarization complete.")
|
24 |
|
|
|
74 |
gr.Markdown("Upload a video")
|
75 |
|
76 |
video_input = gr.Video(label="Upload Video")
|
|
|
|
|
|
|
|
|
|
|
77 |
analyze_button = gr.Button("Analyze")
|
78 |
|
79 |
# Create output components
|
|
|
101 |
|
102 |
analyze_button.click(
|
103 |
fn=analyze_video,
|
104 |
+
inputs=[video_input],
|
105 |
outputs=output_components,
|
106 |
show_progress=True
|
107 |
)
|