Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion fastdeploy/entrypoints/openai/response_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ async def process_response_chat(self, request_outputs, stream, enable_thinking,
)
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)
Expand Down
4 changes: 2 additions & 2 deletions tests/entrypoints/openai/test_response_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ async def test_audio_tts(self):
"""不开启 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]}},
]

Expand Down
Loading