adiv07 commited on
Commit
60eb264
·
verified ·
1 Parent(s): 0e332f0

Update Gpt4oDemo.py

Browse files
Files changed (1) hide show
  1. Gpt4oDemo.py +2 -2
Gpt4oDemo.py CHANGED
@@ -31,7 +31,7 @@ client = openai.OpenAI(
31
  MODEL="gpt-4o"
32
 
33
  # Whisperx config
34
- device = "cpu"
35
  batch_size = 16 # reduce if low on GPU mem
36
  compute_type = "int8" # change to "int8" if low on GPU mem (may reduce accuracy)
37
  from faster_whisper.transcribe import TranscriptionOptions
@@ -99,7 +99,7 @@ def process_video(video_path, seconds_per_frame=2):
99
  clip.audio.write_audiofile(audio_path, bitrate="32k")
100
  clip.audio.close()
101
  clip.close()
102
- # transcribe_video(audio_path)
103
  print(f"Extracted {len(base64Frames)} frames")
104
  print(f"Extracted audio to {audio_path}")
105
  return base64Frames, audio_path
 
31
  MODEL="gpt-4o"
32
 
33
  # Whisperx config
34
+ device = "cuda"
35
  batch_size = 16 # reduce if low on GPU mem
36
  compute_type = "int8" # change to "int8" if low on GPU mem (may reduce accuracy)
37
  from faster_whisper.transcribe import TranscriptionOptions
 
99
  clip.audio.write_audiofile(audio_path, bitrate="32k")
100
  clip.audio.close()
101
  clip.close()
102
+ transcribe_video(audio_path)
103
  print(f"Extracted {len(base64Frames)} frames")
104
  print(f"Extracted audio to {audio_path}")
105
  return base64Frames, audio_path