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
69 lines
2.2 KiB
C#
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;
|
|
}
|
|
}
|