adiv07 commited on
Commit
e30b192
·
verified ·
1 Parent(s): ade0f3f

Update Gpt4oDemo.py

Browse files
Files changed (1) hide show
  1. Gpt4oDemo.py +4 -4
Gpt4oDemo.py CHANGED
@@ -34,8 +34,6 @@ MODEL="gpt-4o"
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
-
38
- # Import the necessary components for TranscriptionOptions
39
  from faster_whisper.transcribe import TranscriptionOptions
40
 
41
  # Initialize TranscriptionOptions with the required arguments
@@ -60,12 +58,14 @@ default_asr_options = TranscriptionOptions(
60
  max_initial_timestamp=1.0,
61
  word_timestamps=False,
62
  prepend_punctuations="\"'“¿([{-",
63
- append_punctuations="\"'.。,,!!??::”)]}、"
 
 
 
64
  )
65
 
66
  # Load the model using whisperx.load_model
67
  model = whisperx.load_model("large-v2", device, compute_type=compute_type)
68
-
69
  '''
70
  Video
71
  '''
 
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
38
 
39
  # Initialize TranscriptionOptions with the required arguments
 
58
  max_initial_timestamp=1.0,
59
  word_timestamps=False,
60
  prepend_punctuations="\"'“¿([{-",
61
+ append_punctuations="\"'.。,,!!??::”)]}、",
62
+ max_new_tokens=512,
63
+ clip_timestamps=True,
64
+ hallucination_silence_threshold=0.5
65
  )
66
 
67
  # Load the model using whisperx.load_model
68
  model = whisperx.load_model("large-v2", device, compute_type=compute_type)
 
69
  '''
70
  Video
71
  '''