Skip to content

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

update websocket-server-2pass

雾聪a8126f7207e1
diff --git a/funasr/runtime/websocket/websocket-server-2pass.cpp b/funasr/runtime/websocket/websocket-server-2pass.cpp
index 0b92c97c9..50f0edc36 100644
--- a/funasr/runtime/websocket/websocket-server-2pass.cpp
+++ b/funasr/runtime/websocket/websocket-server-2pass.cpp
@@ -152,8 +152,10 @@ void WebSocketServer::do_decoder(
} catch (std::exception const& e) {
LOG(ERROR) << e.what();
}
- for (auto& vec : punc_cache) {
- vec.clear();
+ if(punc_cache.size()>0){
+ for (auto& vec : punc_cache) {
+ vec.clear();
+ }
}
if (Result) {
websocketpp::lib::error_code ec;