Update Gpt4oDemo.py
Browse files- Gpt4oDemo.py +2 -2
Gpt4oDemo.py
CHANGED
@@ -31,7 +31,7 @@ client = openai.OpenAI(
|
|
31 |
MODEL="gpt-4o"
|
32 |
|
33 |
# Whisperx config
|
34 |
-
device = "
|
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 |
-
|
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
|