This PR adds support for non-streaming Zipformer CTC ASR models across multiple language bindings, WebAssembly, examples, and CI workflows. - Introduces a new OfflineZipformerCtcModelConfig in C/C++, Python, Swift, Java, Kotlin, Go, Dart, Pascal, and C# APIs - Updates initialization, freeing, and recognition logic to include Zipformer CTC in WASM and Node.js - Adds example scripts and CI steps for downloading, building, and running Zipformer CTC models Model doc is available at https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-ctc/icefall/zipformer.html
67 lines
2.1 KiB
C#
67 lines
2.1 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();
|
|
}
|
|
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;
|
|
}
|
|
}
|