Skip to content

Commit 87e6384

Browse files
authored
[RL] update reschedule finish reason (#2709)
1 parent 667547b commit 87e6384

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fastdeploy/entrypoints/openai/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ChatCompletionResponseChoice(BaseModel):
122122
"""
123123
index: int
124124
message: ChatMessage
125-
finish_reason: Optional[Literal["stop", "length", "tool_calls"]]
125+
finish_reason: Optional[Literal["stop", "length", "tool_calls", "recover_stop"]]
126126

127127

128128
class ChatCompletionResponse(BaseModel):

fastdeploy/entrypoints/openai/serving_chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ async def chat_completion_stream_generator(
222222
choice.finish_reason = "length"
223223

224224
if res.get("error_msg") is not None and "Recover" in res["error_msg"]:
225-
choice.finish_reason = "length"
225+
choice.finish_reason = "recover_stop"
226226

227227
if request.metadata is not None and request.metadata.get("training", False) and delta_text != "":
228228
choice.delta.token_ids = output["token_ids"]
@@ -340,7 +340,7 @@ async def chat_completion_full_generator(
340340
choice.finish_reason = "length"
341341

342342
if final_res.get("error_msg") is not None and "Recover" in final_res["error_msg"]:
343-
choice.finish_reason = "length"
343+
choice.finish_reason = "recover_stop"
344344
choices.append(choice)
345345

346346
num_prompt_tokens = len(prompt_token_ids)

0 commit comments

Comments
 (0)