From 6ef5ccc784d9f7fcd4072dd83c6ceaf1c324b92c Mon Sep 17 00:00:00 2001
From: lyblsgo <lyblsgo@163.com>
Date: 星期二, 25 四月 2023 20:34:53 +0800
Subject: [PATCH] check am.mvn exists

---
 funasr/runtime/onnxruntime/src/funasr-onnx-offline-rtf.cpp |    2 +-
 funasr/runtime/onnxruntime/src/paraformer.cpp              |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/funasr/runtime/onnxruntime/src/funasr-onnx-offline-rtf.cpp b/funasr/runtime/onnxruntime/src/funasr-onnx-offline-rtf.cpp
index 366d993..2678465 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 @@
     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 6d1a909..c2991eb 100644
--- a/funasr/runtime/onnxruntime/src/paraformer.cpp
+++ b/funasr/runtime/onnxruntime/src/paraformer.cpp
@@ -147,6 +147,10 @@
 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)) {

--
Gitblit v1.9.1