sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
Loading...
Searching...
No Matches
SherpaOnnxOnlineModelConfig Struct Reference

Model configuration shared by streaming ASR recognizers. More...

#include <c-api.h>

+ Collaboration diagram for SherpaOnnxOnlineModelConfig:

Public Attributes

SherpaOnnxOnlineTransducerModelConfig transducer
 
SherpaOnnxOnlineParaformerModelConfig paraformer
 
SherpaOnnxOnlineZipformer2CtcModelConfig zipformer2_ctc
 
const char * tokens
 
int32_t num_threads
 
const char * provider
 
int32_t debug
 
const char * model_type
 
const char * modeling_unit
 
const char * bpe_vocab
 
const char * tokens_buf
 
int32_t tokens_buf_size
 
SherpaOnnxOnlineNemoCtcModelConfig nemo_ctc
 
SherpaOnnxOnlineToneCtcModelConfig t_one_ctc
 

Detailed Description

Zero-initialize this struct before use, then fill in the sub-config for the model family you want to use together with the shared fields such as tokens, provider, and num_threads.

Exactly one model family should be configured for each recognizer. For example, set only one of transducer, paraformer, zipformer2_ctc, nemo_ctc, or t_one_ctc.

If multiple model families are configured at the same time, the implementation will choose one of them, and which one is used is implementation-defined. Do not rely on any precedence rule.

Definition at line 232 of file c-api.h.

Member Data Documentation

◆ bpe_vocab

const char* SherpaOnnxOnlineModelConfig::bpe_vocab

Path to the BPE vocabulary file when BPE is used.

Definition at line 259 of file c-api.h.

◆ debug

int32_t SherpaOnnxOnlineModelConfig::debug

Non-zero to print model debug information.

Definition at line 246 of file c-api.h.

◆ model_type

const char* SherpaOnnxOnlineModelConfig::model_type

Optional explicit model type override.

Definition at line 248 of file c-api.h.

◆ modeling_unit

const char* SherpaOnnxOnlineModelConfig::modeling_unit

Modeling unit used by the tokens.

Valid values include:

  • "cjkchar"
  • "bpe"
  • "cjkchar+bpe"

Definition at line 257 of file c-api.h.

◆ nemo_ctc

SherpaOnnxOnlineNemoCtcModelConfig SherpaOnnxOnlineModelConfig::nemo_ctc

Streaming NeMo CTC model files.

Definition at line 266 of file c-api.h.

◆ num_threads

int32_t SherpaOnnxOnlineModelConfig::num_threads

Number of threads used by the ONNX Runtime backend.

Definition at line 242 of file c-api.h.

◆ paraformer

SherpaOnnxOnlineParaformerModelConfig SherpaOnnxOnlineModelConfig::paraformer

Streaming Paraformer model files.

Definition at line 236 of file c-api.h.

◆ provider

const char* SherpaOnnxOnlineModelConfig::provider

Execution provider, for example "cpu", "cuda", or "coreml".

Definition at line 244 of file c-api.h.

◆ t_one_ctc

SherpaOnnxOnlineToneCtcModelConfig SherpaOnnxOnlineModelConfig::t_one_ctc

Streaming T-One CTC model files.

Definition at line 268 of file c-api.h.

◆ tokens

const char* SherpaOnnxOnlineModelConfig::tokens

Path to the tokens file.

Definition at line 240 of file c-api.h.

◆ tokens_buf

const char* SherpaOnnxOnlineModelConfig::tokens_buf

Optional in-memory tokens data. Used instead of tokens when non-NULL.

Definition at line 262 of file c-api.h.

◆ tokens_buf_size

int32_t SherpaOnnxOnlineModelConfig::tokens_buf_size

Size in bytes of tokens_buf, excluding the trailing '\0'.

Definition at line 264 of file c-api.h.

◆ transducer

SherpaOnnxOnlineTransducerModelConfig SherpaOnnxOnlineModelConfig::transducer

Streaming transducer model files.

Definition at line 234 of file c-api.h.

◆ zipformer2_ctc

SherpaOnnxOnlineZipformer2CtcModelConfig SherpaOnnxOnlineModelConfig::zipformer2_ctc

Streaming Zipformer2 CTC model files.

Definition at line 238 of file c-api.h.


The documentation for this struct was generated from the following file: