zhifu gao
2023-03-21 4986ec2dd3012607e7bf771041cff45edc6c5045
funasr/runtime/onnxruntime/src/paraformer_onnx.cpp
@@ -3,14 +3,22 @@
using namespace std;
using namespace paraformer;
ModelImp::ModelImp(const char* path,int nNumThread)
ModelImp::ModelImp(const char* path,int nNumThread, bool quantize)
{
    string model_path = pathAppend(path, "model.onnx");
    string vocab_path = pathAppend(path, "vocab.txt");
    string model_path;
    string vocab_path;
    if(quantize)
    {
        model_path = pathAppend(path, "model_quant.onnx");
    }else{
        model_path = pathAppend(path, "model.onnx");
    }
    vocab_path = pathAppend(path, "vocab.txt");
    fe = new FeatureExtract(3);
    sessionOptions.SetInterOpNumThreads(nNumThread);
    //sessionOptions.SetInterOpNumThreads(1);
    sessionOptions.SetIntraOpNumThreads(nNumThread);
    sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED);
#ifdef _WIN32