Class: Whisper::Params

Inherits:
Object
  • Object
show all
Defined in:
sig/whisper.rbs

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.newObject



188
# File 'sig/whisper.rbs', line 188

def self.new: (

Instance Method Details

#abort_callbackabort_callback?

Returns:



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) {
  # ...
}

Parameters:

Returns:



411
# File 'sig/whisper.rbs', line 411

def abort_callback=: (abort_callback) -> abort_callback

#abort_callback_user_dataObject

Returns:

  • (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.

Parameters:

  • (Object)

Returns:

  • (Object)


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

Yields:

Yield Parameters:

  • user_data (Object)

Yield Returns:

  • (boolish)


461
# File 'sig/whisper.rbs', line 461

def abort_on: { (Object user_data) -> boolish } -> void

#carry_initial_prompttrue, false

Returns:

  • (true, false)


310
# File 'sig/whisper.rbs', line 310

def carry_initial_prompt: () -> (true | false)

#carry_initial_prompt=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


302
# File 'sig/whisper.rbs', line 302

def carry_initial_prompt=: (boolish) -> boolish

#diarizetrue, false

If true, enables diarization.

Returns:

  • (true, false)


316
# File 'sig/whisper.rbs', line 316

def diarize: () -> (true | false)

#diarize=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


312
# File 'sig/whisper.rbs', line 312

def diarize=: (boolish) -> boolish

#durationInteger

Audio duration to process in ms.

Returns:

  • (Integer)


328
# File 'sig/whisper.rbs', line 328

def duration: () -> Integer

#duration=Integer

Parameters:

  • (Integer)

Returns:

  • (Integer)


324
# File 'sig/whisper.rbs', line 324

def duration=: (Integer) -> Integer

#encoder_begin_callbackencoder_begin_callback?

Returns:



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_dataObject

Returns:

  • (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.

Parameters:

  • (Object)

Returns:

  • (Object)


400
# File 'sig/whisper.rbs', line 400

def encoder_begin_callback_user_data=: (Object) -> Object

#entropy_tholdFloat

Similar to OpenAI's "compression_ratio_threshold"

Returns:

  • (Float)


352
# File 'sig/whisper.rbs', line 352

def entropy_thold: () -> Float

#entropy_thold=Float

Parameters:

  • (Float)

Returns:

  • (Float)


348
# File 'sig/whisper.rbs', line 348

def entropy_thold=: (Float) -> Float

#initial_promptString?

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).

Returns:

  • (String, nil)


309
# File 'sig/whisper.rbs', line 309

def initial_prompt: () -> (String | nil)

#initial_prompt=_ToS

Parameters:

  • (_ToS)

Returns:

  • (_ToS)


301
# File 'sig/whisper.rbs', line 301

def initial_prompt=: (_ToS) -> _ToS

#languageString

Returns:

  • (String)


232
# File 'sig/whisper.rbs', line 232

def language: () -> String

#language=String

params.language = "auto" | "en", etc...

Parameters:

  • (String)

Returns:

  • (String)


230
# File 'sig/whisper.rbs', line 230

def language=: (String) -> String # TODO: Enumerate lang names

#length_penaltyFloat

Returns:

  • (Float)


345
# File 'sig/whisper.rbs', line 345

def length_penalty: () -> Float

#length_penalty=Float

Parameters:

  • (Float)

Returns:

  • (Float)


344
# File 'sig/whisper.rbs', line 344

def length_penalty=: (Float) -> Float

#logprob_tholdFloat

Returns:

  • (Float)


355
# File 'sig/whisper.rbs', line 355

def logprob_thold: () -> Float

#logprob_thold=Float

Parameters:

  • (Float)

Returns:

  • (Float)


354
# File 'sig/whisper.rbs', line 354

def logprob_thold=: (Float) -> Float

#max_initial_tsFloat

Returns:

  • (Float)


342
# File 'sig/whisper.rbs', line 342

def max_initial_ts: () -> Float

#max_initial_ts=Float

Parameters:

  • (Float)

Returns:

  • (Float)


338
# File 'sig/whisper.rbs', line 338

def max_initial_ts=: (Float) -> Float

#max_lenInteger

max segment length in characters.

Returns:

  • (Integer)


293
# File 'sig/whisper.rbs', line 293

def max_len: () -> Integer

#max_len=Integer

Parameters:

  • (Integer)

Returns:

  • (Integer)


289
# File 'sig/whisper.rbs', line 289

def max_len=: (Integer) -> Integer

#max_text_tokensInteger

Max tokens to use from past text as prompt for the decoder.

Returns:

  • (Integer)


334
# File 'sig/whisper.rbs', line 334

def max_text_tokens: () -> Integer

#max_text_tokens=Integer

Parameters:

  • (Integer)

Returns:

  • (Integer)


330
# File 'sig/whisper.rbs', line 330

def max_text_tokens=: (Integer) -> Integer

#new_segment_callbacknew_segment_callback?

Returns:



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) {
  # ...
}

Parameters:

Returns:



365
# File 'sig/whisper.rbs', line 365

def new_segment_callback=: (new_segment_callback) -> new_segment_callback

#new_segment_callback_user_dataObject

Returns:

  • (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.

Parameters:

  • (Object)

Returns:

  • (Object)


370
# File 'sig/whisper.rbs', line 370

def new_segment_callback_user_data=: (Object) -> Object

#no_contexttrue, false

If true, does not use past transcription (if any) as initial prompt for the decoder.

Returns:

  • (true, false)


239
# File 'sig/whisper.rbs', line 239

def no_context: () -> (true | false)

#no_context=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


235
# File 'sig/whisper.rbs', line 235

def no_context=: (boolish) -> boolish

#no_speech_tholdFloat

Returns:

  • (Float)


357
# File 'sig/whisper.rbs', line 357

def no_speech_thold: () -> Float

#no_speech_thold=Float

Parameters:

  • (Float)

Returns:

  • (Float)


356
# File 'sig/whisper.rbs', line 356

def no_speech_thold=: (Float) -> Float

#offsetInteger

Start offset in ms.

Returns:

  • (Integer)


322
# File 'sig/whisper.rbs', line 322

def offset: () -> Integer

#offset=Integer

Parameters:

  • (Integer)

Returns:

  • (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.

Yields:

Yield Returns:

  • (void)


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

Yields:

Yield Parameters:

Yield Returns:

  • (void)


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.

Yields:

Yield Parameters:

  • progress (Integer)

Yield Returns:

  • (void)


445
# File 'sig/whisper.rbs', line 445

def on_progress: { (Integer progress) -> void } -> void

If true, prints progress information.

Returns:

  • (true, false)


257
# File 'sig/whisper.rbs', line 257

def print_progress: () -> (true | false)

Parameters:

  • (boolish)

Returns:

  • (boolish)


253
# File 'sig/whisper.rbs', line 253

def print_progress=: (boolish) -> boolish

If true, prints results from within whisper.cpp. (avoid it, use callback instead)

Returns:

  • (true, false)


263
# File 'sig/whisper.rbs', line 263

def print_realtime: () -> (true | false)

Parameters:

  • (boolish)

Returns:

  • (boolish)


259
# File 'sig/whisper.rbs', line 259

def print_realtime=: (boolish) -> boolish

If true, prints special tokens (e.g. , , , etc.).

Returns:

  • (true, false)


251
# File 'sig/whisper.rbs', line 251

def print_special: () -> (true | false)

Parameters:

  • (boolish)

Returns:

  • (boolish)


247
# File 'sig/whisper.rbs', line 247

def print_special=: (boolish) -> boolish

Returns:

  • (true, false)


269
# File 'sig/whisper.rbs', line 269

def print_timestamps: () -> (true | false)

If true, prints timestamps for each text segment when printing realtime.

Parameters:

  • (boolish)

Returns:

  • (boolish)


267
# File 'sig/whisper.rbs', line 267

def print_timestamps=: (boolish) -> boolish

#progress_callbackprogress_callback?

Returns:



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.

Parameters:

Returns:



382
# File 'sig/whisper.rbs', line 382

def progress_callback=: (progress_callback) -> progress_callback

#progress_callback_user_dataObject

Returns:

  • (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.

Parameters:

  • (Object)

Returns:

  • (Object)


388
# File 'sig/whisper.rbs', line 388

def progress_callback_user_data=: (Object) -> Object

#single_segmenttrue, false

If true, forces single segment output (useful for streaming).

Returns:

  • (true, false)


245
# File 'sig/whisper.rbs', line 245

def single_segment: () -> (true | false)

#single_segment=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


241
# File 'sig/whisper.rbs', line 241

def single_segment=: (boolish) -> boolish

#split_on_wordtrue, false

If true, split on word rather than on token (when used with max_len).

Returns:

  • (true, false)


299
# File 'sig/whisper.rbs', line 299

def split_on_word: () -> (true | false)

#split_on_word=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


295
# File 'sig/whisper.rbs', line 295

def split_on_word=: (boolish) -> boolish

#suppress_blanktrue, false

If true, suppresses blank outputs.

Returns:

  • (true, false)


275
# File 'sig/whisper.rbs', line 275

def suppress_blank: () -> (true | false)

#suppress_blank=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


271
# File 'sig/whisper.rbs', line 271

def suppress_blank=: (boolish) -> boolish

#suppress_nsttrue, false

If true, suppresses non-speech-tokens.

Returns:

  • (true, false)


281
# File 'sig/whisper.rbs', line 281

def suppress_nst: () -> (true | false)

#suppress_nst=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


277
# File 'sig/whisper.rbs', line 277

def suppress_nst=: (boolish) -> boolish

#temperatureFloat

Returns:

  • (Float)


337
# File 'sig/whisper.rbs', line 337

def temperature: () -> Float

#temperature=Float

Parameters:

  • (Float)

Returns:

  • (Float)


336
# File 'sig/whisper.rbs', line 336

def temperature=: (Float) -> Float

#temperature_incFloat

Returns:

  • (Float)


347
# File 'sig/whisper.rbs', line 347

def temperature_inc: () -> Float

#temperature_inc=Float

Parameters:

  • (Float)

Returns:

  • (Float)


346
# File 'sig/whisper.rbs', line 346

def temperature_inc=: (Float) -> Float

#token_timestampstrue, false

If true, enables token-level timestamps.

Returns:

  • (true, false)


287
# File 'sig/whisper.rbs', line 287

def token_timestamps: () -> (true | false)

#token_timestamps=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


283
# File 'sig/whisper.rbs', line 283

def token_timestamps=: (boolish) -> boolish

#translatetrue, false

Returns:

  • (true, false)


234
# File 'sig/whisper.rbs', line 234

def translate: () -> (true | false)

#translate=boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


233
# File 'sig/whisper.rbs', line 233

def translate=: (boolish) -> boolish

#vadtrue, false

Returns:

  • (true, false)


425
# File 'sig/whisper.rbs', line 425

def vad: () -> (true | false)

#vad=boolish

Enable VAD

Parameters:

  • (boolish)

Returns:

  • (boolish)


423
# File 'sig/whisper.rbs', line 423

def vad=: (boolish) -> boolish

#vad_model_pathString?

Returns:

  • (String, nil)


430
# File 'sig/whisper.rbs', line 430

def vad_model_path: () -> (String | nil)

#vad_model_path=path, ...

Path to the VAD model

Parameters:

  • (path, URI, nil)

Returns:

  • (path, URI, nil)


428
# File 'sig/whisper.rbs', line 428

def vad_model_path=: (path | URI | nil) -> (path | URI | nil)

#vad_paramsWhisper::VAD::Params



433
# File 'sig/whisper.rbs', line 433

def vad_params: () -> (Whisper::VAD::Params)

#vad_params=Whisper::VAD::Params

Parameters:

Returns:



432
# File 'sig/whisper.rbs', line 432

def vad_params=: (Whisper::VAD::Params) -> Whisper::VAD::Params