Class: Cohere::Transcribe::TranscriptionOptions

Inherits:
Data
  • Object
show all
Defined in:
lib/cohere/transcribe/types.rb,
sig/cohere/transcribe.rbs

Overview

Complete transcription configuration shared with the command-line interface.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model: TypesSupport::DEFAULT_ASR_MODEL_ID, model_revision: nil, adapter: nil, adapter_revision: nil, language: "ar", text_only: false, recursive: true, device: "auto", dtype: "auto", audio_backend: "auto", audio_memory_gb: 4.0, preprocess_workers: nil, pipeline_preparation: true, vad: "silero", vad_engine: "auto", vad_batch_size: 16, vad_block_frames: 512, vad_threads: nil, vad_merge: false, min_dur: 0.5, max_dur: 30.0, max_silence: 0.6, energy_threshold: 50.0, vad_threshold: 0.5, min_silence_ms: 300, speech_pad_ms: 60, batch_size: nil, batch_max_size: nil, batch_audio_seconds: nil, batch_vram_target: 0.9, adaptive_batch: false, pin_memory: false, max_new_tokens: 445, max_retry_tokens: 896, truncation_policy: "retry", stop_repetition_loops: true, alignment: "segment", align_batch_size: 4, align_dtype: "fp32", max_chars: 80, max_cue_dur: 6.0, max_gap: 0.6, publication: nil) ⇒ TranscriptionOptions

Returns a new instance of TranscriptionOptions.



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/cohere/transcribe/types.rb', line 140

def initialize(
  model: TypesSupport::DEFAULT_ASR_MODEL_ID,
  model_revision: nil,
  adapter: nil,
  adapter_revision: nil,
  language: "ar",
  text_only: false,
  recursive: true,
  device: "auto",
  dtype: "auto",
  audio_backend: "auto",
  audio_memory_gb: 4.0,
  preprocess_workers: nil,
  pipeline_preparation: true,
  vad: "silero",
  vad_engine: "auto",
  vad_batch_size: 16,
  vad_block_frames: 512,
  vad_threads: nil,
  vad_merge: false,
  min_dur: 0.5,
  max_dur: 30.0,
  max_silence: 0.6,
  energy_threshold: 50.0,
  vad_threshold: 0.5,
  min_silence_ms: 300,
  speech_pad_ms: 60,
  batch_size: nil,
  batch_max_size: nil,
  batch_audio_seconds: nil,
  batch_vram_target: 0.9,
  adaptive_batch: false,
  pin_memory: false,
  max_new_tokens: 445,
  max_retry_tokens: 896,
  truncation_policy: "retry",
  stop_repetition_loops: true,
  alignment: "segment",
  align_batch_size: 4,
  align_dtype: "fp32",
  max_chars: 80,
  max_cue_dur: 6.0,
  max_gap: 0.6,
  publication: nil
)
  super(
    model: TypesSupport.immutable(model),
    model_revision: TypesSupport.immutable(model_revision),
    adapter: TypesSupport.immutable(adapter),
    adapter_revision: TypesSupport.immutable(adapter_revision),
    language: TypesSupport.immutable(language),
    text_only: text_only,
    recursive: recursive,
    device: TypesSupport.immutable(device),
    dtype: TypesSupport.immutable(dtype),
    audio_backend: TypesSupport.immutable(audio_backend),
    audio_memory_gb: audio_memory_gb,
    preprocess_workers: preprocess_workers,
    pipeline_preparation: pipeline_preparation,
    vad: TypesSupport.immutable(vad),
    vad_engine: TypesSupport.immutable(vad_engine),
    vad_batch_size: vad_batch_size,
    vad_block_frames: vad_block_frames,
    vad_threads: vad_threads,
    vad_merge: vad_merge,
    min_dur: min_dur,
    max_dur: max_dur,
    max_silence: max_silence,
    energy_threshold: energy_threshold,
    vad_threshold: vad_threshold,
    min_silence_ms: min_silence_ms,
    speech_pad_ms: speech_pad_ms,
    batch_size: batch_size,
    batch_max_size: batch_max_size,
    batch_audio_seconds: batch_audio_seconds,
    batch_vram_target: batch_vram_target,
    adaptive_batch: adaptive_batch,
    pin_memory: pin_memory,
    max_new_tokens: max_new_tokens,
    max_retry_tokens: max_retry_tokens,
    truncation_policy: TypesSupport.immutable(truncation_policy),
    stop_repetition_loops: stop_repetition_loops,
    alignment: TypesSupport.immutable(alignment),
    align_batch_size: align_batch_size,
    align_dtype: TypesSupport.immutable(align_dtype),
    max_chars: max_chars,
    max_cue_dur: max_cue_dur,
    max_gap: max_gap,
    publication: publication
  )
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter

Returns:

  • (Object)

    the current value of adapter



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def adapter
  @adapter
end

#adapter_revisionObject (readonly)

Returns the value of attribute adapter_revision

Returns:

  • (Object)

    the current value of adapter_revision



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def adapter_revision
  @adapter_revision
end

#adaptive_batchObject (readonly)

Returns the value of attribute adaptive_batch

Returns:

  • (Object)

    the current value of adaptive_batch



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def adaptive_batch
  @adaptive_batch
end

#align_batch_sizeObject (readonly)

Returns the value of attribute align_batch_size

Returns:

  • (Object)

    the current value of align_batch_size



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def align_batch_size
  @align_batch_size
end

#align_dtypeObject (readonly)

Returns the value of attribute align_dtype

Returns:

  • (Object)

    the current value of align_dtype



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def align_dtype
  @align_dtype
end

#alignmentObject (readonly)

Returns the value of attribute alignment

Returns:

  • (Object)

    the current value of alignment



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def alignment
  @alignment
end

#audio_backendObject (readonly)

Returns the value of attribute audio_backend

Returns:

  • (Object)

    the current value of audio_backend



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def audio_backend
  @audio_backend
end

#audio_memory_gbObject (readonly)

Returns the value of attribute audio_memory_gb

Returns:

  • (Object)

    the current value of audio_memory_gb



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def audio_memory_gb
  @audio_memory_gb
end

#batch_audio_secondsObject (readonly)

Returns the value of attribute batch_audio_seconds

Returns:

  • (Object)

    the current value of batch_audio_seconds



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def batch_audio_seconds
  @batch_audio_seconds
end

#batch_max_sizeObject (readonly)

Returns the value of attribute batch_max_size

Returns:

  • (Object)

    the current value of batch_max_size



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def batch_max_size
  @batch_max_size
end

#batch_sizeObject (readonly)

Returns the value of attribute batch_size

Returns:

  • (Object)

    the current value of batch_size



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def batch_size
  @batch_size
end

#batch_vram_targetObject (readonly)

Returns the value of attribute batch_vram_target

Returns:

  • (Object)

    the current value of batch_vram_target



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def batch_vram_target
  @batch_vram_target
end

#deviceObject (readonly)

Returns the value of attribute device

Returns:

  • (Object)

    the current value of device



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def device
  @device
end

#dtypeObject (readonly)

Returns the value of attribute dtype

Returns:

  • (Object)

    the current value of dtype



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def dtype
  @dtype
end

#energy_thresholdObject (readonly)

Returns the value of attribute energy_threshold

Returns:

  • (Object)

    the current value of energy_threshold



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def energy_threshold
  @energy_threshold
end

#languageObject (readonly)

Returns the value of attribute language

Returns:

  • (Object)

    the current value of language



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def language
  @language
end

#max_charsObject (readonly)

Returns the value of attribute max_chars

Returns:

  • (Object)

    the current value of max_chars



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def max_chars
  @max_chars
end

#max_cue_durObject (readonly)

Returns the value of attribute max_cue_dur

Returns:

  • (Object)

    the current value of max_cue_dur



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def max_cue_dur
  @max_cue_dur
end

#max_durObject (readonly)

Returns the value of attribute max_dur

Returns:

  • (Object)

    the current value of max_dur



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def max_dur
  @max_dur
end

#max_gapObject (readonly)

Returns the value of attribute max_gap

Returns:

  • (Object)

    the current value of max_gap



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def max_gap
  @max_gap
end

#max_new_tokensObject (readonly)

Returns the value of attribute max_new_tokens

Returns:

  • (Object)

    the current value of max_new_tokens



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def max_new_tokens
  @max_new_tokens
end

#max_retry_tokensObject (readonly)

Returns the value of attribute max_retry_tokens

Returns:

  • (Object)

    the current value of max_retry_tokens



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def max_retry_tokens
  @max_retry_tokens
end

#max_silenceObject (readonly)

Returns the value of attribute max_silence

Returns:

  • (Object)

    the current value of max_silence



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def max_silence
  @max_silence
end

#min_durObject (readonly)

Returns the value of attribute min_dur

Returns:

  • (Object)

    the current value of min_dur



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def min_dur
  @min_dur
end

#min_silence_msObject (readonly)

Returns the value of attribute min_silence_ms

Returns:

  • (Object)

    the current value of min_silence_ms



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def min_silence_ms
  @min_silence_ms
end

#modelObject (readonly)

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def model
  @model
end

#model_revisionObject (readonly)

Returns the value of attribute model_revision

Returns:

  • (Object)

    the current value of model_revision



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def model_revision
  @model_revision
end

#pin_memoryObject (readonly)

Returns the value of attribute pin_memory

Returns:

  • (Object)

    the current value of pin_memory



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def pin_memory
  @pin_memory
end

#pipeline_preparationObject (readonly)

Returns the value of attribute pipeline_preparation

Returns:

  • (Object)

    the current value of pipeline_preparation



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def pipeline_preparation
  @pipeline_preparation
end

#preprocess_workersObject (readonly)

Returns the value of attribute preprocess_workers

Returns:

  • (Object)

    the current value of preprocess_workers



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def preprocess_workers
  @preprocess_workers
end

#publicationObject (readonly)

Returns the value of attribute publication

Returns:

  • (Object)

    the current value of publication



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def publication
  @publication
end

#recursiveObject (readonly)

Returns the value of attribute recursive

Returns:

  • (Object)

    the current value of recursive



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def recursive
  @recursive
end

#speech_pad_msObject (readonly)

Returns the value of attribute speech_pad_ms

Returns:

  • (Object)

    the current value of speech_pad_ms



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def speech_pad_ms
  @speech_pad_ms
end

#stop_repetition_loopsObject (readonly)

Returns the value of attribute stop_repetition_loops

Returns:

  • (Object)

    the current value of stop_repetition_loops



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def stop_repetition_loops
  @stop_repetition_loops
end

#text_onlyObject (readonly)

Returns the value of attribute text_only

Returns:

  • (Object)

    the current value of text_only



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def text_only
  @text_only
end

#truncation_policyObject (readonly)

Returns the value of attribute truncation_policy

Returns:

  • (Object)

    the current value of truncation_policy



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def truncation_policy
  @truncation_policy
end

#vadObject (readonly)

Returns the value of attribute vad

Returns:

  • (Object)

    the current value of vad



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def vad
  @vad
end

#vad_batch_sizeObject (readonly)

Returns the value of attribute vad_batch_size

Returns:

  • (Object)

    the current value of vad_batch_size



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def vad_batch_size
  @vad_batch_size
end

#vad_block_framesObject (readonly)

Returns the value of attribute vad_block_frames

Returns:

  • (Object)

    the current value of vad_block_frames



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def vad_block_frames
  @vad_block_frames
end

#vad_engineObject (readonly)

Returns the value of attribute vad_engine

Returns:

  • (Object)

    the current value of vad_engine



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def vad_engine
  @vad_engine
end

#vad_mergeObject (readonly)

Returns the value of attribute vad_merge

Returns:

  • (Object)

    the current value of vad_merge



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def vad_merge
  @vad_merge
end

#vad_threadsObject (readonly)

Returns the value of attribute vad_threads

Returns:

  • (Object)

    the current value of vad_threads



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def vad_threads
  @vad_threads
end

#vad_thresholdObject (readonly)

Returns the value of attribute vad_threshold

Returns:

  • (Object)

    the current value of vad_threshold



95
96
97
# File 'lib/cohere/transcribe/types.rb', line 95

def vad_threshold
  @vad_threshold
end

Class Method Details

.newObject



75
# File 'sig/cohere/transcribe.rbs', line 75

def self.new: (?model: path_input, ?model_revision: String?, ?adapter: path_input?,