Spaces:
Running
Running
jhj0517
commited on
Commit
·
f24a6e8
1
Parent(s):
594c1ea
use wildcard
Browse files
modules/whisper/whisper_parameter.py
CHANGED
@@ -225,48 +225,7 @@ class WhisperParameters:
|
|
225 |
WhisperValues
|
226 |
Data class that has values of parameters
|
227 |
"""
|
228 |
-
return WhisperValues(
|
229 |
-
model_size=args[0],
|
230 |
-
lang=args[1],
|
231 |
-
is_translate=args[2],
|
232 |
-
beam_size=args[3],
|
233 |
-
log_prob_threshold=args[4],
|
234 |
-
no_speech_threshold=args[5],
|
235 |
-
compute_type=args[6],
|
236 |
-
best_of=args[7],
|
237 |
-
patience=args[8],
|
238 |
-
condition_on_previous_text=args[9],
|
239 |
-
initial_prompt=args[10],
|
240 |
-
temperature=args[11],
|
241 |
-
compression_ratio_threshold=args[12],
|
242 |
-
vad_filter=args[13],
|
243 |
-
threshold=args[14],
|
244 |
-
min_speech_duration_ms=args[15],
|
245 |
-
max_speech_duration_s=args[16],
|
246 |
-
min_silence_duration_ms=args[17],
|
247 |
-
speech_pad_ms=args[18],
|
248 |
-
chunk_length_s=args[19],
|
249 |
-
batch_size=args[20],
|
250 |
-
is_diarize=args[21],
|
251 |
-
hf_token=args[22],
|
252 |
-
diarization_device=args[23],
|
253 |
-
length_penalty=args[24],
|
254 |
-
repetition_penalty=args[25],
|
255 |
-
no_repeat_ngram_size=args[26],
|
256 |
-
prefix=args[27],
|
257 |
-
suppress_blank=args[28],
|
258 |
-
suppress_tokens=args[29],
|
259 |
-
max_initial_timestamp=args[30],
|
260 |
-
word_timestamps=args[31],
|
261 |
-
prepend_punctuations=args[32],
|
262 |
-
append_punctuations=args[33],
|
263 |
-
max_new_tokens=args[34],
|
264 |
-
chunk_length=args[35],
|
265 |
-
hallucination_silence_threshold=args[36],
|
266 |
-
hotwords=args[37],
|
267 |
-
language_detection_threshold=args[38],
|
268 |
-
language_detection_segments=args[39]
|
269 |
-
)
|
270 |
|
271 |
|
272 |
@dataclass
|
@@ -305,11 +264,11 @@ class WhisperValues:
|
|
305 |
word_timestamps: bool
|
306 |
prepend_punctuations: Optional[str]
|
307 |
append_punctuations: Optional[str]
|
308 |
-
max_new_tokens: int
|
309 |
-
chunk_length: int
|
310 |
-
hallucination_silence_threshold: float
|
311 |
hotwords: Optional[str]
|
312 |
-
language_detection_threshold: float
|
313 |
language_detection_segments: int
|
314 |
"""
|
315 |
A data class to use Whisper parameters.
|
|
|
225 |
WhisperValues
|
226 |
Data class that has values of parameters
|
227 |
"""
|
228 |
+
return WhisperValues(*args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
|
230 |
|
231 |
@dataclass
|
|
|
264 |
word_timestamps: bool
|
265 |
prepend_punctuations: Optional[str]
|
266 |
append_punctuations: Optional[str]
|
267 |
+
max_new_tokens: Optional[int]
|
268 |
+
chunk_length: Optional[int]
|
269 |
+
hallucination_silence_threshold: Optional[float]
|
270 |
hotwords: Optional[str]
|
271 |
+
language_detection_threshold: Optional[float]
|
272 |
language_detection_segments: int
|
273 |
"""
|
274 |
A data class to use Whisper parameters.
|