From 2e41e8db8e9c5179a19bbcd6f0514c27d5a270ea Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期一, 15 一月 2024 16:36:18 +0800
Subject: [PATCH] replace NULL for onnxruntime/bin

---
 runtime/onnxruntime/bin/funasr-onnx-online-punc.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/runtime/onnxruntime/bin/funasr-onnx-online-punc.cpp b/runtime/onnxruntime/bin/funasr-onnx-online-punc.cpp
index e7a024c..5616fa4 100644
--- a/runtime/onnxruntime/bin/funasr-onnx-online-punc.cpp
+++ b/runtime/onnxruntime/bin/funasr-onnx-online-punc.cpp
@@ -69,7 +69,7 @@
     GetValue(txt_path, TXT_PATH, model_path);
 
     struct timeval start, end;
-    gettimeofday(&start, NULL);
+    gettimeofday(&start, nullptr);
     int thread_num = 1;
     FUNASR_HANDLE punc_hanlde=CTTransformerInit(model_path, thread_num, PUNC_ONLINE);
 
@@ -79,7 +79,7 @@
         exit(-1);
     }
 
-    gettimeofday(&end, NULL);
+    gettimeofday(&end, nullptr);
     long seconds = (end.tv_sec - start.tv_sec);
     long modle_init_micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
     LOG(INFO) << "Model initialization takes " << (double)modle_init_micros / 1000000 << " s";
@@ -107,16 +107,16 @@
         splitString(vad_strs, txt_str, "|");
         string str_out;
         FUNASR_RESULT result = nullptr;
-        gettimeofday(&start, NULL);
+        gettimeofday(&start, nullptr);
         for(auto& vad_str:vad_strs){
-            result=CTTransformerInfer(punc_hanlde, vad_str.c_str(), RASR_NONE, NULL, PUNC_ONLINE, result);
+            result=CTTransformerInfer(punc_hanlde, vad_str.c_str(), RASR_NONE, nullptr, PUNC_ONLINE, result);
             if(result){
                 string msg = CTTransformerGetResult(result, 0);
                 str_out += msg;
                 LOG(INFO)<<"Online result: "<<msg;
             }
         }
-        gettimeofday(&end, NULL);
+        gettimeofday(&end, nullptr);
         seconds = (end.tv_sec - start.tv_sec);
         taking_micros += ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
         LOG(INFO)<<"Results: "<<str_out;

--
Gitblit v1.9.1