reab5555 commited on
Commit
26a111a
·
verified ·
1 Parent(s): d2bb929

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -12
app.py CHANGED
@@ -17,40 +17,34 @@ def analyze_video(video_path, progress=gr.Progress()):
17
  progress(0, desc="Starting analysis...")
18
  progress(0.2, desc="Starting transcription and diarization")
19
  transcription = diarize_audio(video_path)
20
- print("Transcription:", transcription) # Debug print
21
  progress(0.5, desc="Transcription and diarization complete.")
22
 
23
  progress(0.6, desc="Processing transcription")
24
  results = process_input(transcription, llm)
25
- print('results:', results)
26
  progress(0.7, desc="Transcription processing complete.")
27
 
28
  progress(0.9, desc="Generating charts")
29
  charts, explanations, general_impressions = create_charts(results)
30
- print('charts:', charts)
31
- print('explanations:', explanations)
32
- print('general_impressions:', general_impressions)
33
  progress(1.0, desc="Charts generation complete.")
34
 
35
  end_time = time.time()
36
  execution_time = end_time - start_time
37
 
38
- output_components = [
39
- transcription, # transcript
40
- ]
41
 
42
  for i, (speaker_id, speaker_charts) in enumerate(charts.items(), start=1):
43
  speaker_explanations = explanations[speaker_id]
44
  speaker_general_impression = general_impressions[speaker_id]
 
45
  output_components.extend([
46
  f"## {speaker_id}", # speaker header
47
  speaker_general_impression, # speaker impression
48
- speaker_charts["attachment"], # directly pass the Plotly figure
49
  speaker_explanations["attachment"], # attachment explanation
50
- speaker_charts["dimensions"], # directly pass the Plotly figure
51
- speaker_charts["bigfive"], # directly pass the Plotly figure
52
  speaker_explanations["bigfive"], # bigfive explanation
53
- speaker_charts["personality"], # directly pass the Plotly figure
54
  speaker_explanations["personality"], # personality explanation
55
  ])
56
 
 
17
  progress(0, desc="Starting analysis...")
18
  progress(0.2, desc="Starting transcription and diarization")
19
  transcription = diarize_audio(video_path)
 
20
  progress(0.5, desc="Transcription and diarization complete.")
21
 
22
  progress(0.6, desc="Processing transcription")
23
  results = process_input(transcription, llm)
 
24
  progress(0.7, desc="Transcription processing complete.")
25
 
26
  progress(0.9, desc="Generating charts")
27
  charts, explanations, general_impressions = create_charts(results)
 
 
 
28
  progress(1.0, desc="Charts generation complete.")
29
 
30
  end_time = time.time()
31
  execution_time = end_time - start_time
32
 
33
+ output_components = [transcription] # transcript
 
 
34
 
35
  for i, (speaker_id, speaker_charts) in enumerate(charts.items(), start=1):
36
  speaker_explanations = explanations[speaker_id]
37
  speaker_general_impression = general_impressions[speaker_id]
38
+
39
  output_components.extend([
40
  f"## {speaker_id}", # speaker header
41
  speaker_general_impression, # speaker impression
42
+ speaker_charts["attachment"], # direct Plotly figure
43
  speaker_explanations["attachment"], # attachment explanation
44
+ speaker_charts["dimensions"], # direct Plotly figure
45
+ speaker_charts["bigfive"], # direct Plotly figure
46
  speaker_explanations["bigfive"], # bigfive explanation
47
+ speaker_charts["personality"], # direct Plotly figure
48
  speaker_explanations["personality"], # personality explanation
49
  ])
50