Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

fix code style

lyblsgo11ae57445092
diff --git a/funasr/runtime/onnxruntime/src/FsmnVad.cc b/funasr/runtime/onnxruntime/src/FsmnVad.cc
index 69c69ca1c..6de482e00 100644
--- a/funasr/runtime/onnxruntime/src/FsmnVad.cc
+++ b/funasr/runtime/onnxruntime/src/FsmnVad.cc
@@ -1,6 +1,4 @@
-//
-// Created by root on 4/9/23.
-//
+
#include <fstream>
#include "FsmnVad.h"
#include "precomp.h"
@@ -9,8 +7,6 @@
void FsmnVad::init_vad(const std::string &vad_model, const std::string &vad_cmvn, int vad_sample_rate, int vad_silence_duration, int vad_max_len,
float vad_speech_noise_thres) {
-
-
session_options_.SetIntraOpNumThreads(1);
session_options_.SetGraphOptimizationLevel(ORT_ENABLE_ALL);
session_options_.DisableCpuMemArena();
@@ -33,7 +29,6 @@ void FsmnVad::init_vad(const std::string &vad_model, const std::string &vad_cmvn
}
-
void FsmnVad::read_model(const std::string &vad_model) {
try {
vad_session_ = std::make_shared<Ort::Session>(
@@ -46,8 +41,6 @@ void FsmnVad::read_model(const std::string &vad_model) {
GetInputOutputInfo(vad_session_, &vad_in_names_, &vad_out_names_);
}
-
-
void FsmnVad::GetInputOutputInfo(
const std::shared_ptr<Ort::Session> &session,
std::vector<const char *> *in_names, std::vector<const char *> *out_names) {
diff --git a/funasr/runtime/onnxruntime/src/FsmnVad.h b/funasr/runtime/onnxruntime/src/FsmnVad.h
index 839f9ec75..69a1b986f 100644
--- a/funasr/runtime/onnxruntime/src/FsmnVad.h
+++ b/funasr/runtime/onnxruntime/src/FsmnVad.h
@@ -1,6 +1,3 @@
-//
-// Created by zyf on 4/9/23.
-//
#ifndef VAD_SERVER_FSMNVAD_H
#define VAD_SERVER_FSMNVAD_H
diff --git a/funasr/runtime/onnxruntime/src/e2e_vad.h b/funasr/runtime/onnxruntime/src/e2e_vad.h
index b1780a77e..f0c4975a6 100644
--- a/funasr/runtime/onnxruntime/src/e2e_vad.h
+++ b/funasr/runtime/onnxruntime/src/e2e_vad.h
@@ -1,6 +1,3 @@
-//
-// Created by root on 3/31/23.
-//
#include <utility>
#include <vector>
diff --git a/funasr/runtime/onnxruntime/src/paraformer_onnx.cpp b/funasr/runtime/onnxruntime/src/paraformer_onnx.cpp
index 16cf57ae5..1e4a31058 100644
--- a/funasr/runtime/onnxruntime/src/paraformer_onnx.cpp
+++ b/funasr/runtime/onnxruntime/src/paraformer_onnx.cpp
@@ -35,12 +35,12 @@ ModelImp::ModelImp(const char* path,int nNumThread, bool quantize, bool use_vad)
fbank_opts.frame_opts.frame_length_ms = 25;
fbank_opts.energy_floor = 0;
fbank_opts.mel_opts.debug_mel = false;
- //fbank_ = std::make_unique<knf::OnlineFbank>(fbank_opts);
+ // fbank_ = std::make_unique<knf::OnlineFbank>(fbank_opts);
- //sessionOptions.SetInterOpNumThreads(1);
- //sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED);
+ // sessionOptions.SetInterOpNumThreads(1);
sessionOptions.SetIntraOpNumThreads(nNumThread);
sessionOptions.SetGraphOptimizationLevel(ORT_ENABLE_ALL);
+ // DisableCpuMemArena can improve performance
sessionOptions.DisableCpuMemArena();
#ifdef _WIN32