From d20c030e5b75306dd67e8fe9924d5d94eac1bf30 Mon Sep 17 00:00:00 2001
From: wusong <63332221+wusong1128@users.noreply.github.com>
Date: 星期三, 25 九月 2024 15:11:50 +0800
Subject: [PATCH] 解决python ws服务针对尾部非人声录音无结束标识返回的问题 (#2102)

---
 runtime/triton_gpu/client/speech_client.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/runtime/triton_gpu/client/speech_client.py b/runtime/triton_gpu/client/speech_client.py
index 1bafbe2..15482a7 100644
--- a/runtime/triton_gpu/client/speech_client.py
+++ b/runtime/triton_gpu/client/speech_client.py
@@ -71,9 +71,7 @@
         # the exact first chunk length frames
         # since the subsampling will look ahead several frames
         first_chunk_length = (chunk_size - 1) * subsampling + context
-        add_frames = math.ceil(
-            (frame_length_ms - frame_shift_ms) / frame_shift_ms
-        )
+        add_frames = math.ceil((frame_length_ms - frame_shift_ms) / frame_shift_ms)
         first_chunk_ms = (first_chunk_length + add_frames) * frame_shift_ms
         other_chunk_ms = chunk_size * subsampling * frame_shift_ms
         self.first_chunk_in_secs = first_chunk_ms / 1000

--
Gitblit v1.9.1