From 0c6e9ac92f1ccfc045018c8fa93e57087ee23a97 Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期四, 31 八月 2023 17:07:02 +0800
Subject: [PATCH] fix exit conditions

---
 funasr/runtime/onnxruntime/src/paraformer.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/funasr/runtime/onnxruntime/src/paraformer.cpp b/funasr/runtime/onnxruntime/src/paraformer.cpp
index c36a86d..887a463 100644
--- a/funasr/runtime/onnxruntime/src/paraformer.cpp
+++ b/funasr/runtime/onnxruntime/src/paraformer.cpp
@@ -41,7 +41,7 @@
         LOG(INFO) << "Successfully load model from " << am_model;
     } catch (std::exception const &e) {
         LOG(ERROR) << "Error when load am onnx model: " << e.what();
-        exit(0);
+        exit(-1);
     }
 
     string strName;
@@ -93,7 +93,7 @@
         LOG(INFO) << "Successfully load model from " << en_model;
     } catch (std::exception const &e) {
         LOG(ERROR) << "Error when load am encoder model: " << e.what();
-        exit(0);
+        exit(-1);
     }
 
     try {
@@ -101,7 +101,7 @@
         LOG(INFO) << "Successfully load model from " << de_model;
     } catch (std::exception const &e) {
         LOG(ERROR) << "Error when load am decoder model: " << e.what();
-        exit(0);
+        exit(-1);
     }
 
     // encoder
@@ -156,7 +156,7 @@
         LOG(INFO) << "Successfully load model from " << am_model;
     } catch (std::exception const &e) {
         LOG(ERROR) << "Error when load am onnx model: " << e.what();
-        exit(0);
+        exit(-1);
     }
 
     string strName;
@@ -225,7 +225,7 @@
         LOG(INFO) << "Successfully load model from " << hw_model;
     } catch (std::exception const &e) {
         LOG(ERROR) << "Error when load hw compiler onnx model: " << e.what();
-        exit(0);
+        exit(-1);
     }
 
     string strName;
@@ -292,7 +292,7 @@
     ifstream cmvn_stream(filename);
     if (!cmvn_stream.is_open()) {
         LOG(ERROR) << "Failed to open file: " << filename;
-        exit(0);
+        exit(-1);
     }
     string line;
 

--
Gitblit v1.9.1