Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
fix func FunASRWfstDecoderInit
雾聪d4aaa84ad16c
diff --git a/runtime/onnxruntime/include/model.h b/runtime/onnxruntime/include/model.hindex 33caec806..b72db9268 100644--- a/runtime/onnxruntime/include/model.h+++ b/runtime/onnxruntime/include/model.h@@ -24,7 +24,11 @@ class Model {virtual std::vector<std::vector<float>> CompileHotwordEmbedding(std::string &hotwords){return std::vector<std::vector<float>>();};virtual std::string GetLang(){return "";};virtual int GetAsrSampleRate() = 0;+ virtual Vocab* GetVocab(){};+ virtual Vocab* GetLmVocab(){};+ virtual PhoneSet* GetPhoneSet(){};+ std::shared_ptr<fst::Fst<fst::StdArc>> lm_ = nullptr;};Model *CreateModel(std::map<std::string, std::string>& model_path, int thread_num=1, ASR_TYPE type=ASR_OFFLINE);diff --git a/runtime/onnxruntime/src/funasrruntime.cpp b/runtime/onnxruntime/src/funasrruntime.cppindex d795cb0de..b283772ef 100644--- a/runtime/onnxruntime/src/funasrruntime.cpp+++ b/runtime/onnxruntime/src/funasrruntime.cpp@@ -767,13 +767,13 @@funasr::WfstDecoder* mm = nullptr;if (asr_type == ASR_OFFLINE) {funasr::OfflineStream* offline_stream = (funasr::OfflineStream*)handle;- funasr::Paraformer* paraformer = (funasr::Paraformer*)offline_stream->asr_handle.get();+ funasr::Model* paraformer = offline_stream->asr_handle.get();if (paraformer->lm_)mm = new funasr::WfstDecoder(paraformer->lm_.get(),paraformer->GetPhoneSet(), paraformer->GetLmVocab(), glob_beam, lat_beam, am_scale);} else if (asr_type == ASR_TWO_PASS){funasr::TpassStream* tpass_stream = (funasr::TpassStream*)handle;- funasr::Paraformer* paraformer = (funasr::Paraformer*)tpass_stream->asr_handle.get();+ funasr::Model* paraformer = tpass_stream->asr_handle.get();if (paraformer->lm_)mm = new funasr::WfstDecoder(paraformer->lm_.get(),paraformer->GetPhoneSet(), paraformer->GetLmVocab(), glob_beam, lat_beam, am_scale);