adiv07 commited on
Commit
4e8f98d
·
verified ·
1 Parent(s): 37c09e2

Update Gpt4oDemo.py

Browse files
Files changed (1) hide show
  1. Gpt4oDemo.py +3 -2
Gpt4oDemo.py CHANGED
@@ -103,6 +103,7 @@ base64Frames = []
103
  transcript=""
104
 
105
  def process_video(video_path, seconds_per_frame=2, target_width=320, target_height=180):
 
106
  base64Frames = []
107
  base_video_path, _ = os.path.splitext(video_path)
108
 
@@ -164,7 +165,7 @@ chat_history.append({
164
  )
165
  })
166
 
167
- def transcribe_video(filename):
168
  global transcript
169
  if not audio_path:
170
  raise ValueError("Audio path is None")
@@ -198,7 +199,7 @@ def handle_video(video=None):
198
 
199
  if video is None:
200
  # Load example video
201
- video = "./TEST.mp4"
202
 
203
  base64Frames, audio_path = process_video(video, seconds_per_frame=1, target_width=320, target_height=180)
204
  chat_history.append({
 
103
  transcript=""
104
 
105
  def process_video(video_path, seconds_per_frame=2, target_width=320, target_height=180):
106
+ global audio_path
107
  base64Frames = []
108
  base_video_path, _ = os.path.splitext(video_path)
109
 
 
165
  )
166
  })
167
 
168
+ def transcribe_video(audio_path):
169
  global transcript
170
  if not audio_path:
171
  raise ValueError("Audio path is None")
 
199
 
200
  if video is None:
201
  # Load example video
202
+ video = "./Task 1.mp4"
203
 
204
  base64Frames, audio_path = process_video(video, seconds_per_frame=1, target_width=320, target_height=180)
205
  chat_history.append({