From ae3e2567602546e66c0f358463617e560fc70e20 Mon Sep 17 00:00:00 2001
From: lyblsgo <lyblsgo@163.com>
Date: 星期四, 20 四月 2023 14:50:55 +0800
Subject: [PATCH] add offline vad for onnxruntime
---
funasr/runtime/onnxruntime/tester/tester_rtf.cpp | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/funasr/runtime/onnxruntime/tester/tester_rtf.cpp b/funasr/runtime/onnxruntime/tester/tester_rtf.cpp
index 067d5c0..7f2368e 100644
--- a/funasr/runtime/onnxruntime/tester/tester_rtf.cpp
+++ b/funasr/runtime/onnxruntime/tester/tester_rtf.cpp
@@ -19,7 +19,7 @@
std::atomic<int> index(0);
std::mutex mtx;
-void runReg(FUNASR_HANDLE AsrHanlde, vector<string> wav_list,
+void runReg(FUNASR_HANDLE AsrHandle, vector<string> wav_list,
float* total_length, long* total_time, int core_id) {
// cpu_set_t cpuset;
@@ -37,7 +37,7 @@
// warm up
for (size_t i = 0; i < 1; i++)
{
- FUNASR_RESULT Result=FunASRRecogFile(AsrHanlde, wav_list[0].c_str(), RASR_NONE, NULL);
+ FUNASR_RESULT Result=FunASRRecogFile(AsrHandle, wav_list[0].c_str(), RASR_NONE, NULL);
}
while (true) {
@@ -48,7 +48,7 @@
}
gettimeofday(&start, NULL);
- FUNASR_RESULT Result=FunASRRecogFile(AsrHanlde, wav_list[i].c_str(), RASR_NONE, NULL);
+ FUNASR_RESULT Result=FunASRRecogFile(AsrHandle, wav_list[i].c_str(), RASR_NONE, NULL);
gettimeofday(&end, NULL);
seconds = (end.tv_sec - start.tv_sec);
@@ -112,8 +112,8 @@
int nThreadNum = 1;
nThreadNum = atoi(argv[4]);
- FUNASR_HANDLE AsrHanlde=FunASRInit(argv[1], 1, quantize);
- if (!AsrHanlde)
+ FUNASR_HANDLE AsrHandle=FunASRInit(argv[1], 1, quantize);
+ if (!AsrHandle)
{
printf("Cannot load ASR Model from: %s, there must be files model.onnx and vocab.txt", argv[1]);
exit(-1);
@@ -130,7 +130,7 @@
for (int i = 0; i < nThreadNum; i++)
{
- threads.emplace_back(thread(runReg, AsrHanlde, wav_list, &total_length, &total_time, i));
+ threads.emplace_back(thread(runReg, AsrHandle, wav_list, &total_length, &total_time, i));
}
for (auto& thread : threads)
@@ -142,6 +142,6 @@
printf("total_time_comput %ld ms.\n", total_time / 1000);
printf("total_rtf %05lf .\n", (double)total_time/ (total_length*1000000));
- FunASRUninit(AsrHanlde);
+ FunASRUninit(AsrHandle);
return 0;
}
--
Gitblit v1.9.1