Update Gpt4oDemo.py
Browse files- Gpt4oDemo.py +21 -8
Gpt4oDemo.py
CHANGED
@@ -38,16 +38,29 @@ compute_type = "int8" # change to "int8" if low on GPU mem (may reduce accuracy)
|
|
38 |
# Import the necessary components for TranscriptionOptions
|
39 |
from faster_whisper.transcribe import TranscriptionOptions
|
40 |
|
41 |
-
# Define the required arguments for TranscriptionOptions
|
42 |
-
max_new_tokens = 512 # Example value, adjust as needed
|
43 |
-
clip_timestamps = True # Example value, adjust as needed
|
44 |
-
hallucination_silence_threshold = 0.5 # Example value, adjust as needed
|
45 |
-
|
46 |
# Initialize TranscriptionOptions with the required arguments
|
47 |
default_asr_options = TranscriptionOptions(
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
)
|
52 |
|
53 |
# Load the model using whisperx.load_model
|
|
|
38 |
# Import the necessary components for TranscriptionOptions
|
39 |
from faster_whisper.transcribe import TranscriptionOptions
|
40 |
|
|
|
|
|
|
|
|
|
|
|
41 |
# Initialize TranscriptionOptions with the required arguments
|
42 |
default_asr_options = TranscriptionOptions(
|
43 |
+
beam_size=5,
|
44 |
+
best_of=5,
|
45 |
+
patience=0.0,
|
46 |
+
length_penalty=1.0,
|
47 |
+
repetition_penalty=1.0,
|
48 |
+
no_repeat_ngram_size=0,
|
49 |
+
log_prob_threshold=-1.0,
|
50 |
+
no_speech_threshold=0.6,
|
51 |
+
compression_ratio_threshold=2.4,
|
52 |
+
condition_on_previous_text=True,
|
53 |
+
prompt_reset_on_temperature=True,
|
54 |
+
temperatures=[0.0],
|
55 |
+
initial_prompt=None,
|
56 |
+
prefix=None,
|
57 |
+
suppress_blank=True,
|
58 |
+
suppress_tokens=[],
|
59 |
+
without_timestamps=False,
|
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
|