Class: Whisper::Params

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new ⇒ Object



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

def self.new: (

Instance Method Details

#abort_callback ⇒ abort_callback?

Returns:



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

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:



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

def abort_callback=: (abort_callback) -> abort_callback

#abort_callback_user_data ⇒ Object

Returns:

  • (Object)


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

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)


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

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)


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

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

#carry_initial_prompt ⇒ true, false

Returns:

  • (true, false)


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

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

#carry_initial_prompt= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def carry_initial_prompt=: (boolish) -> boolish

#diarize ⇒ true, false

If true, enables diarization.

Returns:

  • (true, false)


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

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

#diarize= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def diarize=: (boolish) -> boolish

#duration ⇒ Integer

Audio duration to process in ms.

Returns:

  • (Integer)


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

def duration: () -> Integer

#duration= ⇒ Integer

Parameters:

  • (Integer)

Returns:

  • (Integer)


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

def duration=: (Integer) -> Integer

#encoder_begin_callback ⇒ encoder_begin_callback?

Returns:



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

def encoder_begin_callback: () -> (encoder_begin_callback | nil)

#encoder_begin_callback= ⇒ encoder_begin_callback

Sets encoder begin callback, called when the encoder starts.



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

def encoder_begin_callback=: (encoder_begin_callback) -> encoder_begin_callback

#encoder_begin_callback_user_data ⇒ Object

Returns:

  • (Object)


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

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)


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

def encoder_begin_callback_user_data=: (Object) -> Object

#entropy_thold ⇒ Float

Similar to OpenAI's "compression_ratio_threshold"

Returns:

  • (Float)


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

def entropy_thold: () -> Float

#entropy_thold= ⇒ Float

Parameters:

  • (Float)

Returns:

  • (Float)


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

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

Returns:

  • (String, nil)


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

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

#initial_prompt= ⇒ _ToS

Parameters:

  • (_ToS)

Returns:

  • (_ToS)


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

def initial_prompt=: (_ToS) -> _ToS

#language ⇒ String

Returns:

  • (String)


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

def language: () -> String

#language= ⇒ String

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

Parameters:

  • (String)

Returns:

  • (String)


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

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

#length_penalty ⇒ Float

Returns:

  • (Float)


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

def length_penalty: () -> Float

#length_penalty= ⇒ Float

Parameters:

  • (Float)

Returns:

  • (Float)


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

def length_penalty=: (Float) -> Float

#logprob_thold ⇒ Float

Returns:

  • (Float)


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

def logprob_thold: () -> Float

#logprob_thold= ⇒ Float

Parameters:

  • (Float)

Returns:

  • (Float)


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

def logprob_thold=: (Float) -> Float

#max_initial_ts ⇒ Float

Returns:

  • (Float)


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

def max_initial_ts: () -> Float

#max_initial_ts= ⇒ Float

Parameters:

  • (Float)

Returns:

  • (Float)


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

def max_initial_ts=: (Float) -> Float

#max_len ⇒ Integer

max segment length in characters.

Returns:

  • (Integer)


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

def max_len: () -> Integer

#max_len= ⇒ Integer

Parameters:

  • (Integer)

Returns:

  • (Integer)


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

def max_len=: (Integer) -> Integer

#max_text_tokens ⇒ Integer

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

Returns:

  • (Integer)


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

def max_text_tokens: () -> Integer

#max_text_tokens= ⇒ Integer

Parameters:

  • (Integer)

Returns:

  • (Integer)


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

def max_text_tokens=: (Integer) -> Integer

#new_segment_callback ⇒ new_segment_callback?

Returns:



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

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:



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

def new_segment_callback=: (new_segment_callback) -> new_segment_callback

#new_segment_callback_user_data ⇒ Object

Returns:

  • (Object)


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

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)


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

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.

Returns:

  • (true, false)


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

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

#no_context= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def no_context=: (boolish) -> boolish

#no_speech_thold ⇒ Float

Returns:

  • (Float)


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

def no_speech_thold: () -> Float

#no_speech_thold= ⇒ Float

Parameters:

  • (Float)

Returns:

  • (Float)


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

def no_speech_thold=: (Float) -> Float

#offset ⇒ Integer

Start offset in ms.

Returns:

  • (Integer)


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

def offset: () -> Integer

#offset= ⇒ Integer

Parameters:

  • (Integer)

Returns:

  • (Integer)


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

def offset=: (Integer) -> Integer

#on_encoder_begin { ... } ⇒ void

This method returns an undefined value.

Hook called on encoder starts.

Yields:

Yield Returns:

  • (void)


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

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)


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

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)


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

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

If true, prints progress information.

Returns:

  • (true, false)


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

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

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def print_progress=: (boolish) -> boolish

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

Returns:

  • (true, false)


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

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

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def print_realtime=: (boolish) -> boolish

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

Returns:

  • (true, false)


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

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

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def print_special=: (boolish) -> boolish

Returns:

  • (true, false)


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

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

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

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def print_timestamps=: (boolish) -> boolish

#progress_callback ⇒ progress_callback?

Returns:



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

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:



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

def progress_callback=: (progress_callback) -> progress_callback

#progress_callback_user_data ⇒ Object

Returns:

  • (Object)


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

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)


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

def progress_callback_user_data=: (Object) -> Object

#single_segment ⇒ true, false

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

Returns:

  • (true, false)


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

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

#single_segment= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def single_segment=: (boolish) -> boolish

#split_on_word ⇒ true, false

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

Returns:

  • (true, false)


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

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

#split_on_word= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def split_on_word=: (boolish) -> boolish

#suppress_blank ⇒ true, false

If true, suppresses blank outputs.

Returns:

  • (true, false)


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

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

#suppress_blank= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def suppress_blank=: (boolish) -> boolish

#suppress_nst ⇒ true, false

If true, suppresses non-speech-tokens.

Returns:

  • (true, false)


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

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

#suppress_nst= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def suppress_nst=: (boolish) -> boolish

#temperature ⇒ Float

Returns:

  • (Float)


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

def temperature: () -> Float

#temperature= ⇒ Float

Parameters:

  • (Float)

Returns:

  • (Float)


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

def temperature=: (Float) -> Float

#temperature_inc ⇒ Float

Returns:

  • (Float)


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

def temperature_inc: () -> Float

#temperature_inc= ⇒ Float

Parameters:

  • (Float)

Returns:

  • (Float)


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

def temperature_inc=: (Float) -> Float

#token_timestamps ⇒ true, false

If true, enables token-level timestamps.

Returns:

  • (true, false)


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

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

#token_timestamps= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def token_timestamps=: (boolish) -> boolish

#translate ⇒ true, false

Returns:

  • (true, false)


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

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

#translate= ⇒ boolish

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def translate=: (boolish) -> boolish

#vad ⇒ true, false

Returns:

  • (true, false)


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

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

#vad= ⇒ boolish

Enable VAD

Parameters:

  • (boolish)

Returns:

  • (boolish)


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

def vad=: (boolish) -> boolish

#vad_model_path ⇒ String?

Returns:

  • (String, nil)


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

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

#vad_model_path= ⇒ path, ...

Path to the VAD model

Parameters:

  • (path, URI, nil)

Returns:

  • (path, URI, nil)


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

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

#vad_params ⇒ Whisper::VAD::Params



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

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

#vad_params= ⇒ Whisper::VAD::Params

Parameters:

Returns:



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

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