雾聪
2023-08-31 0c6e9ac92f1ccfc045018c8fa93e57087ee23a97
fix exit conditions
6个文件已修改
30 ■■■■ 已修改文件
funasr/runtime/onnxruntime/src/audio.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/onnxruntime/src/ct-transformer-online.cpp 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/onnxruntime/src/ct-transformer.cpp 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/onnxruntime/src/fsmn-vad.cpp 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/onnxruntime/src/paraformer.cpp 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/onnxruntime/src/tpass-online-stream.cpp 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/runtime/onnxruntime/src/audio.cpp
@@ -1163,8 +1163,8 @@
            }else if(speech_end_i != -1){ // [-1,100]
                if(speech_start == -1 or speech_offline_start == -1){
                    LOG(ERROR) <<"Vad start is null while vad end is available." ;
                    exit(-1);
                    LOG(ERROR) <<"Vad start is null while vad end is available. Set vad start 0" ;
                    speech_start = 0;
                }
                int start = speech_start*seg_sample;
funasr/runtime/onnxruntime/src/ct-transformer-online.cpp
@@ -22,7 +22,7 @@
    }
    catch (std::exception const &e) {
        LOG(ERROR) << "Error when load punc onnx model: " << e.what();
        exit(0);
        exit(-1);
    }
    // read inputnames outputnames
    string strName;
@@ -226,7 +226,6 @@
    catch (std::exception const &e)
    {
        LOG(ERROR) << "Error when run punc onnx forword: " << (e.what());
        exit(0);
    }
    return punction;
}
funasr/runtime/onnxruntime/src/ct-transformer.cpp
@@ -22,7 +22,7 @@
    }
    catch (std::exception const &e) {
        LOG(ERROR) << "Error when load punc onnx model: " << e.what();
        exit(0);
        exit(-1);
    }
    // read inputnames outputnames
    string strName;
@@ -184,7 +184,6 @@
    catch (std::exception const &e)
    {
        LOG(ERROR) << "Error when run punc onnx forword: " << (e.what());
        exit(0);
    }
    return punction;
}
funasr/runtime/onnxruntime/src/fsmn-vad.cpp
@@ -58,7 +58,7 @@
        LOG(INFO) << "Successfully load model from " << vad_model;
    } catch (std::exception const &e) {
        LOG(ERROR) << "Error when load vad onnx model: " << e.what();
        exit(0);
        exit(-1);
    }
    GetInputOutputInfo(vad_session_, &vad_in_names_, &vad_out_names_);
}
@@ -197,7 +197,7 @@
        ifstream cmvn_stream(filename);
        if (!cmvn_stream.is_open()) {
            LOG(ERROR) << "Failed to open file: " << filename;
            exit(0);
            exit(-1);
        }
        string line;
@@ -230,7 +230,7 @@
        }
    }catch(std::exception const &e) {
        LOG(ERROR) << "Error when load vad cmvn : " << e.what();
        exit(0);
        exit(-1);
    }
}
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;
funasr/runtime/onnxruntime/src/tpass-online-stream.cpp
@@ -7,7 +7,7 @@
    if(tpass_obj->vad_handle){
        vad_online_handle = make_unique<FsmnVadOnline>((FsmnVad*)(tpass_obj->vad_handle).get());
    }else{
        LOG(ERROR)<<"asr_handle is null";
        LOG(ERROR)<<"vad_handle is null";
        exit(-1);
    }