| | |
| | | return mm; |
| | | } |
| | | |
| | | _FUNASRAPI FUNASR_HANDLE FunPuncInit(std::map<std::string, std::string>& model_path, int thread_num) |
| | | _FUNASRAPI FUNASR_HANDLE CTTransformerInit(std::map<std::string, std::string>& model_path, int thread_num) |
| | | { |
| | | funasr::PuncModel* mm = funasr::CreatePuncModel(model_path, thread_num); |
| | | return mm; |
| | |
| | | } |
| | | |
| | | // APIs for PUNC Infer |
| | | _FUNASRAPI const std::string FunPuncInfer(FUNASR_HANDLE handle, const char* sz_sentence, FUNASR_MODE mode, QM_CALLBACK fn_callback) |
| | | _FUNASRAPI const std::string CTTransformerInfer(FUNASR_HANDLE handle, const char* sz_sentence, FUNASR_MODE mode, QM_CALLBACK fn_callback) |
| | | { |
| | | funasr::PuncModel* punc_obj = (funasr::PuncModel*)handle; |
| | | if (!punc_obj) |
| | |
| | | delete recog_obj; |
| | | } |
| | | |
| | | _FUNASRAPI void FunPuncUninit(FUNASR_HANDLE handle) |
| | | _FUNASRAPI void CTTransformerUninit(FUNASR_HANDLE handle) |
| | | { |
| | | funasr::PuncModel* punc_obj = (funasr::PuncModel*)handle; |
| | | |