Shi Xian
2024-01-16 948b68774cebf2b9a2994b7b9b8102f9637a98f3
runtime/onnxruntime/bin/funasr-onnx-2pass-rtf.cpp
@@ -144,10 +144,10 @@
                } else {
                    is_final = false;
            }
            gettimeofday(&start, NULL);
            gettimeofday(&start, nullptr);
            FUNASR_RESULT result = FunTpassInferBuffer(tpass_handle, tpass_online_handle, speech_buff+sample_offset, step, punc_cache, is_final, 
                                                        sampling_rate_, "pcm", (ASR_TYPE)asr_mode_, hotwords_embedding, true, decoder_handle);
            gettimeofday(&end, NULL);
            gettimeofday(&end, nullptr);
            seconds = (end.tv_sec - start.tv_sec);
            long taking_micros = ((seconds * 1000000) + end.tv_usec) - (start.tv_usec);
            n_total_time += taking_micros;
@@ -272,7 +272,7 @@
    GetValue(asr_mode, ASR_MODE, model_path);
    struct timeval start, end;
    gettimeofday(&start, NULL);
    gettimeofday(&start, nullptr);
    int thread_num = onnx_thread.getValue();
    int asr_mode_ = -1;
    if(model_path[ASR_MODE] == "offline"){
@@ -301,7 +301,7 @@
        am_sc = am_scale.getValue();
    }
    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";