yhliang
2023-05-10 f77c5803f4d61099e572be8d877b1c4a4d6087cd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "precomp.h"
 
namespace funasr {
Model *CreateModel(std::map<std::string, std::string>& model_path, int thread_num)
{
    string am_model_path;
    string am_cmvn_path;
    string am_config_path;
 
    am_model_path = PathAppend(model_path.at(MODEL_DIR), MODEL_NAME);
    if(model_path.find(QUANTIZE) != model_path.end() && model_path.at(QUANTIZE) == "true"){
        am_model_path = PathAppend(model_path.at(MODEL_DIR), QUANT_MODEL_NAME);
    }
    am_cmvn_path = PathAppend(model_path.at(MODEL_DIR), AM_CMVN_NAME);
    am_config_path = PathAppend(model_path.at(MODEL_DIR), AM_CONFIG_NAME);
 
    Model *mm;
    mm = new Paraformer();
    mm->InitAsr(am_model_path, am_cmvn_path, am_config_path, thread_num);
    return mm;
}
 
} // namespace funasr