This repository has been archived on 2025-08-26. You can view files and clone it, but cannot push or open issues or pull requests.
Files
enginex_bi_series-sherpa-onnx/scripts/dotnet/OfflineModelConfig.cs
Fangjun Kuang fd9a687ec2 Add Pascal/Go/C#/Dart API for NeMo Canary ASR models (#2367)
Add support for the new NeMo Canary ASR model across multiple language bindings by introducing a Canary model configuration and setter method on the offline recognizer.

- Define Canary model config in Pascal, Go, C#, Dart and update converter functions
- Add SetConfig API for offline recognizer (Pascal, Go, C#, Dart)
- Extend CI/workflows and example scripts to test non-streaming Canary decoding
2025-07-10 14:53:33 +08:00

69 lines
2.2 KiB
C#

/// Copyright (c) 2024.5 by 东风破
using System.Runtime.InteropServices;
namespace SherpaOnnx
{
[StructLayout(LayoutKind.Sequential)]
public struct OfflineModelConfig
{
public OfflineModelConfig()
{
Transducer = new OfflineTransducerModelConfig();
Paraformer = new OfflineParaformerModelConfig();
NeMoCtc = new OfflineNemoEncDecCtcModelConfig();
Whisper = new OfflineWhisperModelConfig();
Tdnn = new OfflineTdnnModelConfig();
Tokens = "";
NumThreads = 1;
Debug = 0;
Provider = "cpu";
ModelType = "";
ModelingUnit = "cjkchar";
BpeVocab = "";
TeleSpeechCtc = "";
SenseVoice = new OfflineSenseVoiceModelConfig();
Moonshine = new OfflineMoonshineModelConfig();
FireRedAsr = new OfflineFireRedAsrModelConfig();
Dolphin = new OfflineDolphinModelConfig();
ZipformerCtc = new OfflineZipformerCtcModelConfig();
Canary = new OfflineCanaryModelConfig();
}
public OfflineTransducerModelConfig Transducer;
public OfflineParaformerModelConfig Paraformer;
public OfflineNemoEncDecCtcModelConfig NeMoCtc;
public OfflineWhisperModelConfig Whisper;
public OfflineTdnnModelConfig Tdnn;
[MarshalAs(UnmanagedType.LPStr)]
public string Tokens;
public int NumThreads;
public int Debug;
[MarshalAs(UnmanagedType.LPStr)]
public string Provider;
[MarshalAs(UnmanagedType.LPStr)]
public string ModelType;
[MarshalAs(UnmanagedType.LPStr)]
public string ModelingUnit;
[MarshalAs(UnmanagedType.LPStr)]
public string BpeVocab;
[MarshalAs(UnmanagedType.LPStr)]
public string TeleSpeechCtc;
public OfflineSenseVoiceModelConfig SenseVoice;
public OfflineMoonshineModelConfig Moonshine;
public OfflineFireRedAsrModelConfig FireRedAsr;
public OfflineDolphinModelConfig Dolphin;
public OfflineZipformerCtcModelConfig ZipformerCtc;
public OfflineCanaryModelConfig Canary;
}
}