Make stop reason a dict instead of str (#1407)

This commit is contained in:
Lianmin Zheng
2024-09-12 20:47:31 -07:00
committed by GitHub
parent eb02c1618a
commit b912de11b0
3 changed files with 60 additions and 44 deletions
+5 -1
View File
@@ -813,7 +813,11 @@ class ModelTpServer:
"prompt_tokens": len(req.origin_input_ids),
"completion_tokens": len(req.output_ids),
"completion_tokens_wo_jump_forward": req.completion_tokens_wo_jump_forward,
"finish_reason": str(req.finished_reason),
"finish_reason": (
req.finished_reason.to_json()
if req.finished_reason is not None
else None
),
}
if req.return_logprob:
(