reab5555 commited on
Commit
95282a2
·
verified ·
1 Parent(s): 203e76f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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, max_speakers, 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,7 +18,7 @@ def analyze_video(video_path, max_speakers, 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, max_speakers)
22
  print("Transcription:", transcription) # Debug print
23
  progress(0.5, desc="Transcription and diarization complete.")
24
 
@@ -74,7 +74,6 @@ with gr.Blocks() as iface:
74
  gr.Markdown("Upload a video")
75
 
76
  video_input = gr.Video(label="Upload Video")
77
- max_speakers = gr.Slider(minimum=1, maximum=3, step=1, value=2, label="Maximum Number of Speakers")
78
  analyze_button = gr.Button("Analyze")
79
 
80
  # Create output components
@@ -102,7 +101,7 @@ with gr.Blocks() as iface:
102
 
103
  analyze_button.click(
104
  fn=analyze_video,
105
- inputs=[video_input, max_speakers],
106
  outputs=output_components,
107
  show_progress=True
108
  )
 
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
  )