FunASRNanoOptions

Options & Configuration · AiDotNet.SpeechRecognition.AlibabaASR

Options for Fun-ASR-nano: an LLM-based recognizer of a SenseVoice-Small encoder, an adaptor and Qwen3-0.6B.

Inheritance: ModelOptions → FunASRNanoOptions

For Beginners

Defaults are the released Fun-ASR-Nano-2512 configuration: a 50+20-block SAN-M encoder of width 512 over 80-band filterbanks stacked seven every six frames; a two-layer adaptor to Qwen3-0.6B’s width of 1,024; Qwen3-0.6B itself (28 layers, 16 query and 8 key-value heads of width 128, 151,936 tokens, tied embeddings); and a five-layer CTC decoder over a 60,515-token vocabulary. Training uses AdamW at 5e-6 with 2,500 warmup steps and gradient clipping at 5, as the release does.

Constructors

Constructor Summary
FunASRNanoOptions() Initializes a new instance with default values.
FunASRNanoOptions(FunASRNanoOptions other) Initializes a new instance by copying from another instance.

Properties

Property Summary
FunASRNanoTrainingStage TrainingStage { get; set; } The modules a training step updates: the report’s §4.2 stages, which presuppose a pretrained Qwen3, or Joint (the default) for a model trained from its random initialization.
OnnxModelOptions OnnxOptions { get; set; } Gets or sets the ONNX Runtime settings used when the model is loaded from an ONNX file.
bool InverseTextNormalization { get; set; } Whether the transcript is inverse-text-normalized; false adds “,不进行文本规整” to the prompt.
double LlmRmsEpsilon { get; set; } Gets or sets the RMS-normalization stability constant for the language-model.
double LlmRopeTheta { get; set; } Gets or sets the rotary positional-embedding frequency base for the language-model.
double LoraAlpha { get; set; } Gets or sets the LoRA adapter scaling factor.
double LoraDropout { get; set; } Gets or sets the dropout probability of the LoRA adapter.
int AdaptorDownsampleRate { get; set; } Encoder frames the adaptor concatenates per output (1).
int AdaptorFeedForwardDim { get; set; } The adaptor’s projection width (2,048).
int AdaptorHeads { get; set; } The attention heads of the adaptor’s and the CTC decoder’s Transformer layers (8).
int CtcDecoderDim { get; set; } The CTC decoder’s width (512).
int CtcFeedForwardDim { get; set; } The CTC decoder’s projection width (2,048).
int CtcVocabSize { get; set; } The CTC vocabulary (60,515); its last token is the blank.
int EncoderDim { get; set; } The audio encoder’s width (512).
int EncoderFeedForwardDim { get; set; } The encoder’s feed-forward width (2,048).
int FsmnKernelSize { get; set; } The FSMN memory’s kernel (11).
int LfrM { get; set; } Frames stacked per low-frame-rate step (7).
int LfrN { get; set; } Low-frame-rate stride in frames (6, a 60 ms step).
int LlmHeadDim { get; set; } Qwen3-0.6B’s head width (128).
int LlmHeads { get; set; } Qwen3-0.6B’s query heads (16).
int LlmHiddenDim { get; set; } Qwen3-0.6B’s width (1,024).
int LlmIntermediateDim { get; set; } Qwen3-0.6B’s SwiGLU width (3,072).
int LlmKeyValueHeads { get; set; } Qwen3-0.6B’s key-value heads (8).
int LoraRank { get; set; } The LoRA rank on the LLM’s query and value projections (16, the release’s lora_conf).
int MaxAudioLengthSeconds { get; set; } The longest recording transcribed (30 seconds).
int MaxTextLength { get; set; } The longest answer generated, in tokens.
int NumAdaptorLayers { get; set; } The adaptor’s Transformer encoder layers (2).
int NumAttentionHeads { get; set; } The encoder’s attention heads (4).
int NumCtcDecoderLayers { get; set; } The CTC decoder’s Transformer encoder layers (5).
int NumEncoderLayers { get; set; } The encoder’s first group of SAN-M blocks (50).
int NumLlmLayers { get; set; } Qwen3-0.6B’s layers (28).
int NumMels { get; set; } Filterbank bands (80).
int NumTpEncoderLayers { get; set; } The encoder’s second group of SAN-M blocks (20).
int SampleRate { get; set; } Gets or sets the sample rate, in Hz, that input audio is expected at.
int VocabSize { get; set; } The LLM’s vocabulary (151,936, Qwen3’s).
int WarmupSteps { get; set; } Linear warmup steps before the inverse-square-root decay of the release’s AdamW recipe (2,500).
string Language { get; set; } The transcript’s language named in the prompt; empty or “auto” leaves it unnamed.
string ModelPath { get; set; } Gets or sets the path to the model weights.
string SystemPrompt { get; set; } The ChatML system message (“You are a helpful assistant.”).
string[] Hotwords { get; set; } Hotwords placed in the prompt’s context section; none by default.
string[] Vocabulary { get; set; } Optional vocabulary mapping token ids to text when the vocabulary is not Qwen’s.