alexnasa commited on
Commit
73cae84
·
verified ·
1 Parent(s): ecb1630

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -70,7 +70,22 @@ class WhisperModel:
70
  class WhisperxModel:
71
  def __init__(self, model_name, align_model: WhisperxAlignModel):
72
  from whisperx import load_model
73
- self.model = load_model(model_name, device, asr_options={"suppress_numerals": True, "max_new_tokens": None, "clip_timestamps": None, "hallucination_silence_threshold": None})
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  self.align_model = align_model
75
 
76
  def transcribe(self, audio_path):
@@ -142,7 +157,7 @@ def transcribe(seed, audio_path):
142
 
143
  # then load the ASR+alignment combo
144
  transcribe_model = WhisperxModel(
145
- model_name="large-v3-turbo", # or "base.en", "small.en", etc.
146
  align_model=aligner
147
  )
148
 
 
70
  class WhisperxModel:
71
  def __init__(self, model_name, align_model: WhisperxAlignModel):
72
  from whisperx import load_model
73
+ # build an asr_options dict that matches the new TranscriptionOptions signature
74
+ asr_opts = {
75
+ "suppress_numerals": True,
76
+ "max_new_tokens": None,
77
+ "clip_timestamps": None,
78
+ "hallucination_silence_threshold": None,
79
+ # new required args:
80
+ "multilingual": False,
81
+ "hotwords": {} # or a list like [], or a dict mapping words→boost weights
82
+ }
83
+ # pass them through
84
+ self.model = load_model(
85
+ model_name,
86
+ device,
87
+ asr_options=asr_opts
88
+ )
89
  self.align_model = align_model
90
 
91
  def transcribe(self, audio_path):
 
157
 
158
  # then load the ASR+alignment combo
159
  transcribe_model = WhisperxModel(
160
+ model_name="large.en", # or "base.en", "small.en", etc.
161
  align_model=aligner
162
  )
163