Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

check am.mvn exists

lyblsgo6ef5ccc784d9
diff --git a/funasr/runtime/onnxruntime/src/funasr-onnx-offline-rtf.cpp b/funasr/runtime/onnxruntime/src/funasr-onnx-offline-rtf.cpp
index 366d993e0..26784657b 100644
--- a/funasr/runtime/onnxruntime/src/funasr-onnx-offline-rtf.cpp
+++ b/funasr/runtime/onnxruntime/src/funasr-onnx-offline-rtf.cpp
@@ -144,7 +144,7 @@ int main(int argc, char *argv[])
if(model_path.find(WAV_SCP)!=model_path.end()){
ifstream in(model_path.at(WAV_SCP));
if (!in.is_open()) {
- LOG(ERROR) << ("Failed to open file: %s", model_path.at(WAV_SCP));
+ LOG(ERROR) << "Failed to open file: " << model_path.at(WAV_SCP);
return 0;
}
string line;
diff --git a/funasr/runtime/onnxruntime/src/paraformer.cpp b/funasr/runtime/onnxruntime/src/paraformer.cpp
index 6d1a9099b..c2991eb96 100644
--- a/funasr/runtime/onnxruntime/src/paraformer.cpp
+++ b/funasr/runtime/onnxruntime/src/paraformer.cpp
@@ -147,6 +147,10 @@ vector<float> Paraformer::FbankKaldi(float sample_rate, const float* waves, int
void Paraformer::LoadCmvn(const char *filename)
{
ifstream cmvn_stream(filename);
+ if (!cmvn_stream.is_open()) {
+ LOG(ERROR) << "Failed to open file: " << filename;
+ exit(0);
+ }
string line;
while (getline(cmvn_stream, line)) {