From 219c2482ab755fbd4e49dfbdee91bf1a8a4ec49a Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 19 五月 2023 11:33:27 +0800
Subject: [PATCH] websocket 2pass bugfix
---
funasr/runtime/onnxruntime/src/funasr-onnx-offline-punc.cpp | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/funasr-onnx-offline-punc.cpp b/funasr/runtime/onnxruntime/src/funasr-onnx-offline-punc.cpp
index e8f221f..e18c27e 100644
--- a/funasr/runtime/onnxruntime/src/funasr-onnx-offline-punc.cpp
+++ b/funasr/runtime/onnxruntime/src/funasr-onnx-offline-punc.cpp
@@ -14,7 +14,7 @@
#include <sstream>
#include <map>
#include <glog/logging.h>
-#include "libfunasrapi.h"
+#include "funasrruntime.h"
#include "tclap/CmdLine.h"
#include "com-define.h"
@@ -36,7 +36,7 @@
TCLAP::CmdLine cmd("funasr-onnx-offline-punc", ' ', "1.0");
TCLAP::ValueArg<std::string> model_dir("", MODEL_DIR, "the punc model path, which contains model.onnx, punc.yaml", true, "", "string");
TCLAP::ValueArg<std::string> quantize("", QUANTIZE, "false (Default), load the model of model.onnx in model_dir. If set true, load the model of model_quant.onnx in model_dir", false, "false", "string");
- TCLAP::ValueArg<std::string> txt_path("", TXT_PATH, "txt file path, one sentence per line", false, "", "string");
+ TCLAP::ValueArg<std::string> txt_path("", TXT_PATH, "txt file path, one sentence per line", true, "", "string");
cmd.add(model_dir);
cmd.add(quantize);
@@ -51,7 +51,7 @@
struct timeval start, end;
gettimeofday(&start, NULL);
int thread_num = 1;
- FUNASR_HANDLE punc_hanlde=FunPuncInit(model_path, thread_num);
+ FUNASR_HANDLE punc_hanlde=CTTransformerInit(model_path, thread_num);
if (!punc_hanlde)
{
@@ -84,7 +84,7 @@
long taking_micros = 0;
for(auto& txt_str : txt_list){
gettimeofday(&start, NULL);
- string result=FunPuncInfer(punc_hanlde, txt_str.c_str(), RASR_NONE, NULL);
+ string result=CTTransformerInfer(punc_hanlde, txt_str.c_str(), RASR_NONE, NULL);
gettimeofday(&end, NULL);
seconds = (end.tv_sec - start.tv_sec);
taking_micros += ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
@@ -92,7 +92,7 @@
}
LOG(INFO) << "Model inference takes: " << (double)taking_micros / 1000000 <<" s";
- FunPuncUninit(punc_hanlde);
+ CTTransformerUninit(punc_hanlde);
return 0;
}
--
Gitblit v1.9.1