Add C++ runtime for Tele-AI/TeleSpeech-ASR (#970)
This commit is contained in:
@@ -34,6 +34,9 @@ class OfflineDecodeFiles
|
||||
[Option(Required = false, Default = "",HelpText = "Path to transducer joiner.onnx. Used only for transducer models")]
|
||||
public string Joiner { get; set; }
|
||||
|
||||
[Option("model-type", Required = false, Default = "", HelpText = "model type")]
|
||||
public string ModelType { get; set; }
|
||||
|
||||
[Option("whisper-encoder", Required = false, Default = "", HelpText = "Path to whisper encoder.onnx. Used only for whisper models")]
|
||||
public string WhisperEncoder { get; set; }
|
||||
|
||||
@@ -56,6 +59,9 @@ class OfflineDecodeFiles
|
||||
[Option("nemo-ctc", Required = false, HelpText = "Path to model.onnx. Used only for NeMo CTC models")]
|
||||
public string NeMoCtc { get; set; }
|
||||
|
||||
[Option("telespeech-ctc", Required = false, HelpText = "Path to model.onnx. Used only for TeleSpeech CTC models")]
|
||||
public string TeleSpeechCtc { get; set; }
|
||||
|
||||
[Option("num-threads", Required = false, Default = 1, HelpText = "Number of threads for computation")]
|
||||
public int NumThreads { get; set; }
|
||||
|
||||
@@ -201,6 +207,10 @@ to download pre-trained Tdnn models.
|
||||
{
|
||||
config.ModelConfig.NeMoCtc.Model = options.NeMoCtc;
|
||||
}
|
||||
else if (!String.IsNullOrEmpty(options.TeleSpeechCtc))
|
||||
{
|
||||
config.ModelConfig.TeleSpeechCtc = options.TeleSpeechCtc;
|
||||
}
|
||||
else if (!String.IsNullOrEmpty(options.WhisperEncoder))
|
||||
{
|
||||
config.ModelConfig.Whisper.Encoder = options.WhisperEncoder;
|
||||
@@ -218,6 +228,7 @@ to download pre-trained Tdnn models.
|
||||
return;
|
||||
}
|
||||
|
||||
config.ModelConfig.ModelType = options.ModelType;
|
||||
config.DecodingMethod = options.DecodingMethod;
|
||||
config.MaxActivePaths = options.MaxActivePaths;
|
||||
config.HotwordsFile = options.HotwordsFile;
|
||||
|
||||
15
dotnet-examples/offline-decode-files/run-telespeech-ctc.sh
Executable file
15
dotnet-examples/offline-decode-files/run-telespeech-ctc.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
if [ ! -d sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04 ]; then
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04.tar.bz2
|
||||
tar xvf sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04.tar.bz2
|
||||
rm sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04.tar.bz2
|
||||
fi
|
||||
|
||||
dotnet run \
|
||||
--telespeech-ctc=./sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04/model.int8.onnx \
|
||||
--tokens=./sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04/tokens.txt \
|
||||
--model-type=telespeech-ctc \
|
||||
--files ./sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04/test_wavs/3-sichuan.wav
|
||||
Reference in New Issue
Block a user