mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
[RL] update reschedule finish reason (#2709)
This commit is contained in:
@@ -122,7 +122,7 @@ class ChatCompletionResponseChoice(BaseModel):
|
||||
"""
|
||||
index: int
|
||||
message: ChatMessage
|
||||
finish_reason: Optional[Literal["stop", "length", "tool_calls"]]
|
||||
finish_reason: Optional[Literal["stop", "length", "tool_calls", "recover_stop"]]
|
||||
|
||||
|
||||
class ChatCompletionResponse(BaseModel):
|
||||
|
@@ -222,7 +222,7 @@ class OpenAIServingChat:
|
||||
choice.finish_reason = "length"
|
||||
|
||||
if res.get("error_msg") is not None and "Recover" in res["error_msg"]:
|
||||
choice.finish_reason = "length"
|
||||
choice.finish_reason = "recover_stop"
|
||||
|
||||
if request.metadata is not None and request.metadata.get("training", False) and delta_text != "":
|
||||
choice.delta.token_ids = output["token_ids"]
|
||||
@@ -340,7 +340,7 @@ class OpenAIServingChat:
|
||||
choice.finish_reason = "length"
|
||||
|
||||
if final_res.get("error_msg") is not None and "Recover" in final_res["error_msg"]:
|
||||
choice.finish_reason = "length"
|
||||
choice.finish_reason = "recover_stop"
|
||||
choices.append(choice)
|
||||
|
||||
num_prompt_tokens = len(prompt_token_ids)
|
||||
|
Reference in New Issue
Block a user