Make stop reason a dict instead of str (#1407)
This commit is contained in:
@@ -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:
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user