雾聪
2024-03-27 16a3cd3cfb866e99b68417e36a7c8ae613678fbf
runtime/onnxruntime/src/paraformer-torch.cpp
@@ -45,8 +45,15 @@
    #ifdef USE_IPEX
    torch::jit::setTensorExprFuserEnabled(false);
    #endif
    torch::jit::script::Module model = torch::jit::load(am_model, device);
    model_ = std::make_shared<TorchModule>(std::move(model));
    try {
        torch::jit::script::Module model = torch::jit::load(am_model, device);
        model_ = std::make_shared<TorchModule>(std::move(model));
        LOG(INFO) << "Successfully load model from " << am_model;
    } catch (std::exception const &e) {
        LOG(ERROR) << "Error when load am model: " << am_model << e.what();
        exit(-1);
    }
}
void ParaformerTorch::InitLm(const std::string &lm_file, 
@@ -359,6 +366,7 @@
}
std::vector<std::vector<float>> ParaformerTorch::CompileHotwordEmbedding(std::string &hotwords) {
    // TODO
    std::vector<std::vector<float>> result(1, std::vector<float>(10, 0.0f));
    return result;
}