mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
[BugFix] fix audio end bug (#5464)
This commit is contained in:
@@ -115,7 +115,9 @@ class ChatResponseProcessor:
|
||||
)
|
||||
yield response
|
||||
elif decode_type == 2: # audio
|
||||
if self.eoa_token_id is not None and self.eoa_token_id in token_ids:
|
||||
if self.eoa_token_id is not None and any(
|
||||
token_id >= self.eoa_token_id for token_id in token_ids
|
||||
):
|
||||
continue
|
||||
if req_id in self._audio_buffer:
|
||||
self._audio_buffer[req_id].append(token_ids)
|
||||
|
||||
@@ -60,9 +60,9 @@ class TestChatResponseProcessor(unittest.IsolatedAsyncioTestCase):
|
||||
"""不开启 multimodal,直接走 data_processor"""
|
||||
processor = ChatResponseProcessor(self.mock_data_processor)
|
||||
request_outputs = [
|
||||
{"request_id": "req1", "outputs": {"decode_type": 2, "token_ids": [[11, 22]]}},
|
||||
{"request_id": "req1", "outputs": {"decode_type": 2, "token_ids": [11, 22]}},
|
||||
{"request_id": "req1", "outputs": {"decode_type": 0, "token_ids": [1]}},
|
||||
{"request_id": "req1", "outputs": {"decode_type": 2, "token_ids": [[11, 22]]}},
|
||||
{"request_id": "req1", "outputs": {"decode_type": 2, "token_ids": [11, 22]}},
|
||||
{"request_id": "req1", "outputs": {"decode_type": 0, "token_ids": [2]}},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user