Skip to content

Commit 2f6f063

Browse files
committed
fix parser
1 parent d087afb commit 2f6f063

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fastdeploy/reasoning/ernie_x1_reasoning_parsers.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,14 @@ def extract_reasoning_content_streaming(
122122
):
123123
return DeltaMessage(content=delta_text)
124124
elif model_status == "think_end":
125-
if self.response_start_token_id in current_token_ids:
125+
if (
126+
self.response_start_token_id in current_token_ids
127+
and self.response_end_token_id not in current_token_ids
128+
):
126129
return DeltaMessage(content=delta_text)
127130
elif model_status == "response_start":
128-
return DeltaMessage(content=delta_text)
131+
if self.response_end_token_id not in current_token_ids:
132+
return DeltaMessage(content=delta_text)
129133

130134
return None
131135

0 commit comments

Comments
 (0)