Class: Whisper::Params
- Inherits:
-
Object
- Object
- Whisper::Params
- Defined in:
- sig/whisper.rbs
Class Method Summary collapse
Instance Method Summary collapse
- #abort_callback ⇒ abort_callback?
-
#abort_callback= ⇒ abort_callback
Sets abort callback, called to check if the process should be aborted.
- #abort_callback_user_data ⇒ Object
-
#abort_callback_user_data= ⇒ Object
Sets user data passed to the last argument of abort callback.
-
#abort_on {|user_data| ... } ⇒ void
Call block to determine whether abort or not.
- #carry_initial_prompt ⇒ true, false
- #carry_initial_prompt= ⇒ boolish
-
#diarize ⇒ true, false
If
true, enables diarization. - #diarize= ⇒ boolish
-
#duration ⇒ Integer
Audio duration to process in ms.
- #duration= ⇒ Integer
- #encoder_begin_callback ⇒ encoder_begin_callback?
-
#encoder_begin_callback= ⇒ encoder_begin_callback
Sets encoder begin callback, called when the encoder starts.
- #encoder_begin_callback_user_data ⇒ Object
-
#encoder_begin_callback_user_data= ⇒ Object
Sets user data passed to the last argument of encoder begin callback.
-
#entropy_thold ⇒ Float
Similar to OpenAI's "compression_ratio_threshold".
- #entropy_thold= ⇒ Float
-
#initial_prompt ⇒ String?
Tokens to provide to the whisper decoder as initial prompt these are prepended to any existing text context from a previous call use whisper_tokenize() to convert text to tokens.
- #initial_prompt= ⇒ _ToS
- #language ⇒ String
-
#language= ⇒ String
params.language = "auto" | "en", etc...
- #length_penalty ⇒ Float
- #length_penalty= ⇒ Float
- #logprob_thold ⇒ Float
- #logprob_thold= ⇒ Float
- #max_initial_ts ⇒ Float
- #max_initial_ts= ⇒ Float
-
#max_len ⇒ Integer
max segment length in characters.
- #max_len= ⇒ Integer
-
#max_text_tokens ⇒ Integer
Max tokens to use from past text as prompt for the decoder.
- #max_text_tokens= ⇒ Integer
- #new_segment_callback ⇒ new_segment_callback?
-
#new_segment_callback= ⇒ new_segment_callback
Sets new segment callback, called for every newly generated text segment.
- #new_segment_callback_user_data ⇒ Object
-
#new_segment_callback_user_data= ⇒ Object
Sets user data passed to the last argument of new segment callback.
-
#no_context ⇒ true, false
If
true, does not use past transcription (if any) as initial prompt for the decoder. - #no_context= ⇒ boolish
- #no_speech_thold ⇒ Float
- #no_speech_thold= ⇒ Float
-
#offset ⇒ Integer
Start offset in ms.
- #offset= ⇒ Integer
-
#on_encoder_begin { ... } ⇒ void
Hook called on encoder starts.
-
#on_new_segment {|arg0| ... } ⇒ void
Hook called on new segment.
-
#on_progress {|progress| ... } ⇒ void
Hook called on progress update.
-
#print_progress ⇒ true, false
If
true, prints progress information. - #print_progress= ⇒ boolish
-
#print_realtime ⇒ true, false
If
true, prints results from within whisper.cpp. - #print_realtime= ⇒ boolish
-
#print_special ⇒ true, false
If
true, prints special tokens (e.g., , , etc.). - #print_special= ⇒ boolish
- #print_timestamps ⇒ true, false
-
#print_timestamps= ⇒ boolish
If
true, prints timestamps for each text segment when printing realtime. - #progress_callback ⇒ progress_callback?
-
#progress_callback= ⇒ progress_callback
Sets progress callback, called on each progress update.
- #progress_callback_user_data ⇒ Object
-
#progress_callback_user_data= ⇒ Object
Sets user data passed to the last argument of progress callback.
-
#single_segment ⇒ true, false
If
true, forces single segment output (useful for streaming). - #single_segment= ⇒ boolish
-
#split_on_word ⇒ true, false
If
true, split on word rather than on token (when used with max_len). - #split_on_word= ⇒ boolish
-
#suppress_blank ⇒ true, false
If
true, suppresses blank outputs. - #suppress_blank= ⇒ boolish
-
#suppress_nst ⇒ true, false
If
true, suppresses non-speech-tokens. - #suppress_nst= ⇒ boolish
- #temperature ⇒ Float
- #temperature= ⇒ Float
- #temperature_inc ⇒ Float
- #temperature_inc= ⇒ Float
-
#token_timestamps ⇒ true, false
If
true, enables token-level timestamps. - #token_timestamps= ⇒ boolish
- #translate ⇒ true, false
- #translate= ⇒ boolish
- #vad ⇒ true, false
-
#vad= ⇒ boolish
Enable VAD.
- #vad_model_path ⇒ String?
-
#vad_model_path= ⇒ path, ...
Path to the VAD model.
- #vad_params ⇒ Whisper::VAD::Params
- #vad_params= ⇒ Whisper::VAD::Params
Class Method Details
.new ⇒ Object
188 |
# File 'sig/whisper.rbs', line 188
def self.new: (
|
Instance Method Details
#abort_callback ⇒ abort_callback?
413 |
# File 'sig/whisper.rbs', line 413
def abort_callback: () -> (abort_callback | nil)
|
#abort_callback= ⇒ abort_callback
Sets abort callback, called to check if the process should be aborted.
params.abort_callback = ->(user_data) {
# ...
}
411 |
# File 'sig/whisper.rbs', line 411
def abort_callback=: (abort_callback) -> abort_callback
|
#abort_callback_user_data ⇒ Object
419 |
# File 'sig/whisper.rbs', line 419
def abort_callback_user_data: () -> Object
|
#abort_callback_user_data= ⇒ Object
Sets user data passed to the last argument of abort callback.
417 |
# File 'sig/whisper.rbs', line 417
def abort_callback_user_data=: (Object) -> Object
|
#abort_on {|user_data| ... } ⇒ void
This method returns an undefined value.
Call block to determine whether abort or not. Return true when you want to abort.
params.abort_on do
if some_condition
true # abort
else
false # continue
end
end
461 |
# File 'sig/whisper.rbs', line 461
def abort_on: { (Object user_data) -> boolish } -> void
|
#carry_initial_prompt ⇒ true, false
310 |
# File 'sig/whisper.rbs', line 310
def carry_initial_prompt: () -> (true | false)
|
#carry_initial_prompt= ⇒ boolish
302 |
# File 'sig/whisper.rbs', line 302
def carry_initial_prompt=: (boolish) -> boolish
|
#diarize ⇒ true, false
If true, enables diarization.
316 |
# File 'sig/whisper.rbs', line 316
def diarize: () -> (true | false)
|
#diarize= ⇒ boolish
312 |
# File 'sig/whisper.rbs', line 312
def diarize=: (boolish) -> boolish
|
#duration ⇒ Integer
Audio duration to process in ms.
328 |
# File 'sig/whisper.rbs', line 328
def duration: () -> Integer
|
#duration= ⇒ Integer
324 |
# File 'sig/whisper.rbs', line 324
def duration=: (Integer) -> Integer
|
#encoder_begin_callback ⇒ encoder_begin_callback?
396 |
# File 'sig/whisper.rbs', line 396
def encoder_begin_callback: () -> (encoder_begin_callback | nil)
|
#encoder_begin_callback= ⇒ encoder_begin_callback
Sets encoder begin callback, called when the encoder starts.
394 |
# File 'sig/whisper.rbs', line 394
def encoder_begin_callback=: (encoder_begin_callback) -> encoder_begin_callback
|
#encoder_begin_callback_user_data ⇒ Object
402 |
# File 'sig/whisper.rbs', line 402
def encoder_begin_callback_user_data: () -> Object
|
#encoder_begin_callback_user_data= ⇒ Object
Sets user data passed to the last argument of encoder begin callback.
400 |
# File 'sig/whisper.rbs', line 400
def encoder_begin_callback_user_data=: (Object) -> Object
|
#entropy_thold ⇒ Float
Similar to OpenAI's "compression_ratio_threshold"
352 |
# File 'sig/whisper.rbs', line 352
def entropy_thold: () -> Float
|
#entropy_thold= ⇒ Float
348 |
# File 'sig/whisper.rbs', line 348
def entropy_thold=: (Float) -> Float
|
#initial_prompt ⇒ String?
Tokens to provide to the whisper decoder as initial prompt these are prepended to any existing text context from a previous call use whisper_tokenize() to convert text to tokens. Maximum of whisper_n_text_ctx()/2 tokens are used (typically 224).
309 |
# File 'sig/whisper.rbs', line 309
def initial_prompt: () -> (String | nil)
|
#initial_prompt= ⇒ _ToS
301 |
# File 'sig/whisper.rbs', line 301
def initial_prompt=: (_ToS) -> _ToS
|
#language ⇒ String
232 |
# File 'sig/whisper.rbs', line 232
def language: () -> String
|
#language= ⇒ String
params.language = "auto" | "en", etc...
230 |
# File 'sig/whisper.rbs', line 230
def language=: (String) -> String # TODO: Enumerate lang names
|
#length_penalty ⇒ Float
345 |
# File 'sig/whisper.rbs', line 345
def length_penalty: () -> Float
|
#length_penalty= ⇒ Float
344 |
# File 'sig/whisper.rbs', line 344
def length_penalty=: (Float) -> Float
|
#logprob_thold ⇒ Float
355 |
# File 'sig/whisper.rbs', line 355
def logprob_thold: () -> Float
|
#logprob_thold= ⇒ Float
354 |
# File 'sig/whisper.rbs', line 354
def logprob_thold=: (Float) -> Float
|
#max_initial_ts ⇒ Float
342 |
# File 'sig/whisper.rbs', line 342
def max_initial_ts: () -> Float
|
#max_initial_ts= ⇒ Float
338 |
# File 'sig/whisper.rbs', line 338
def max_initial_ts=: (Float) -> Float
|
#max_len ⇒ Integer
max segment length in characters.
293 |
# File 'sig/whisper.rbs', line 293
def max_len: () -> Integer
|
#max_len= ⇒ Integer
289 |
# File 'sig/whisper.rbs', line 289
def max_len=: (Integer) -> Integer
|
#max_text_tokens ⇒ Integer
Max tokens to use from past text as prompt for the decoder.
334 |
# File 'sig/whisper.rbs', line 334
def max_text_tokens: () -> Integer
|
#max_text_tokens= ⇒ Integer
330 |
# File 'sig/whisper.rbs', line 330
def max_text_tokens=: (Integer) -> Integer
|
#new_segment_callback ⇒ new_segment_callback?
366 |
# File 'sig/whisper.rbs', line 366
def new_segment_callback: () -> (new_segment_callback | nil)
|
#new_segment_callback= ⇒ new_segment_callback
Sets new segment callback, called for every newly generated text segment.
params.new_segment_callback = ->(context, _, n_new, user_data) {
# ...
}
365 |
# File 'sig/whisper.rbs', line 365
def new_segment_callback=: (new_segment_callback) -> new_segment_callback
|
#new_segment_callback_user_data ⇒ Object
372 |
# File 'sig/whisper.rbs', line 372
def new_segment_callback_user_data: () -> Object
|
#new_segment_callback_user_data= ⇒ Object
Sets user data passed to the last argument of new segment callback.
370 |
# File 'sig/whisper.rbs', line 370
def new_segment_callback_user_data=: (Object) -> Object
|
#no_context ⇒ true, false
If true, does not use past transcription (if any) as initial prompt for the decoder.
239 |
# File 'sig/whisper.rbs', line 239
def no_context: () -> (true | false)
|
#no_context= ⇒ boolish
235 |
# File 'sig/whisper.rbs', line 235
def no_context=: (boolish) -> boolish
|
#no_speech_thold ⇒ Float
357 |
# File 'sig/whisper.rbs', line 357
def no_speech_thold: () -> Float
|
#no_speech_thold= ⇒ Float
356 |
# File 'sig/whisper.rbs', line 356
def no_speech_thold=: (Float) -> Float
|
#offset ⇒ Integer
Start offset in ms.
322 |
# File 'sig/whisper.rbs', line 322
def offset: () -> Integer
|
#offset= ⇒ Integer
318 |
# File 'sig/whisper.rbs', line 318
def offset=: (Integer) -> Integer
|
#on_encoder_begin { ... } ⇒ void
This method returns an undefined value.
Hook called on encoder starts.
449 |
# File 'sig/whisper.rbs', line 449
def on_encoder_begin: { () -> void } -> void
|
#on_new_segment {|arg0| ... } ⇒ void
This method returns an undefined value.
Hook called on new segment. Yields each Whisper::Segment.
whisper.on_new_segment do |segment|
# ...
end
441 |
# File 'sig/whisper.rbs', line 441
def on_new_segment: { (Segment) -> void } -> void
|
#on_progress {|progress| ... } ⇒ void
This method returns an undefined value.
Hook called on progress update. Yields each progress Integer between 0 and 100.
445 |
# File 'sig/whisper.rbs', line 445
def on_progress: { (Integer progress) -> void } -> void
|
#print_progress ⇒ true, false
If true, prints progress information.
257 |
# File 'sig/whisper.rbs', line 257
def print_progress: () -> (true | false)
|
#print_progress= ⇒ boolish
253 |
# File 'sig/whisper.rbs', line 253
def print_progress=: (boolish) -> boolish
|
#print_realtime ⇒ true, false
If true, prints results from within whisper.cpp. (avoid it, use callback instead)
263 |
# File 'sig/whisper.rbs', line 263
def print_realtime: () -> (true | false)
|
#print_realtime= ⇒ boolish
259 |
# File 'sig/whisper.rbs', line 259
def print_realtime=: (boolish) -> boolish
|
#print_special ⇒ true, false
If true, prints special tokens (e.g.
251 |
# File 'sig/whisper.rbs', line 251
def print_special: () -> (true | false)
|
#print_special= ⇒ boolish
247 |
# File 'sig/whisper.rbs', line 247
def print_special=: (boolish) -> boolish
|
#print_timestamps ⇒ true, false
269 |
# File 'sig/whisper.rbs', line 269
def print_timestamps: () -> (true | false)
|
#print_timestamps= ⇒ boolish
If true, prints timestamps for each text segment when printing realtime.
267 |
# File 'sig/whisper.rbs', line 267
def print_timestamps=: (boolish) -> boolish
|
#progress_callback ⇒ progress_callback?
384 |
# File 'sig/whisper.rbs', line 384
def progress_callback: () -> (progress_callback | nil)
|
#progress_callback= ⇒ progress_callback
Sets progress callback, called on each progress update.
params.new_segment_callback = ->(context, _, progress, user_data) {
# ...
}
progress is an Integer between 0 and 100.
382 |
# File 'sig/whisper.rbs', line 382
def progress_callback=: (progress_callback) -> progress_callback
|
#progress_callback_user_data ⇒ Object
390 |
# File 'sig/whisper.rbs', line 390
def progress_callback_user_data: () -> Object
|
#progress_callback_user_data= ⇒ Object
Sets user data passed to the last argument of progress callback.
388 |
# File 'sig/whisper.rbs', line 388
def progress_callback_user_data=: (Object) -> Object
|
#single_segment ⇒ true, false
If true, forces single segment output (useful for streaming).
245 |
# File 'sig/whisper.rbs', line 245
def single_segment: () -> (true | false)
|
#single_segment= ⇒ boolish
241 |
# File 'sig/whisper.rbs', line 241
def single_segment=: (boolish) -> boolish
|
#split_on_word ⇒ true, false
If true, split on word rather than on token (when used with max_len).
299 |
# File 'sig/whisper.rbs', line 299
def split_on_word: () -> (true | false)
|
#split_on_word= ⇒ boolish
295 |
# File 'sig/whisper.rbs', line 295
def split_on_word=: (boolish) -> boolish
|
#suppress_blank ⇒ true, false
If true, suppresses blank outputs.
275 |
# File 'sig/whisper.rbs', line 275
def suppress_blank: () -> (true | false)
|
#suppress_blank= ⇒ boolish
271 |
# File 'sig/whisper.rbs', line 271
def suppress_blank=: (boolish) -> boolish
|
#suppress_nst ⇒ true, false
If true, suppresses non-speech-tokens.
281 |
# File 'sig/whisper.rbs', line 281
def suppress_nst: () -> (true | false)
|
#suppress_nst= ⇒ boolish
277 |
# File 'sig/whisper.rbs', line 277
def suppress_nst=: (boolish) -> boolish
|
#temperature ⇒ Float
337 |
# File 'sig/whisper.rbs', line 337
def temperature: () -> Float
|
#temperature= ⇒ Float
336 |
# File 'sig/whisper.rbs', line 336
def temperature=: (Float) -> Float
|
#temperature_inc ⇒ Float
347 |
# File 'sig/whisper.rbs', line 347
def temperature_inc: () -> Float
|
#temperature_inc= ⇒ Float
346 |
# File 'sig/whisper.rbs', line 346
def temperature_inc=: (Float) -> Float
|
#token_timestamps ⇒ true, false
If true, enables token-level timestamps.
287 |
# File 'sig/whisper.rbs', line 287
def token_timestamps: () -> (true | false)
|
#token_timestamps= ⇒ boolish
283 |
# File 'sig/whisper.rbs', line 283
def token_timestamps=: (boolish) -> boolish
|
#translate ⇒ true, false
234 |
# File 'sig/whisper.rbs', line 234
def translate: () -> (true | false)
|
#translate= ⇒ boolish
233 |
# File 'sig/whisper.rbs', line 233
def translate=: (boolish) -> boolish
|
#vad ⇒ true, false
425 |
# File 'sig/whisper.rbs', line 425
def vad: () -> (true | false)
|
#vad= ⇒ boolish
Enable VAD
423 |
# File 'sig/whisper.rbs', line 423
def vad=: (boolish) -> boolish
|
#vad_model_path ⇒ String?
430 |
# File 'sig/whisper.rbs', line 430
def vad_model_path: () -> (String | nil)
|
#vad_model_path= ⇒ path, ...
Path to the VAD model
428 |
# File 'sig/whisper.rbs', line 428
def vad_model_path=: (path | URI | nil) -> (path | URI | nil)
|
#vad_params ⇒ Whisper::VAD::Params
433 |
# File 'sig/whisper.rbs', line 433
def vad_params: () -> (Whisper::VAD::Params)
|
#vad_params= ⇒ Whisper::VAD::Params
432 |
# File 'sig/whisper.rbs', line 432
def vad_params=: (Whisper::VAD::Params) -> Whisper::VAD::Params
|