From 78c1d6445fa64667e5691826abbb35b1423e8486 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Mon, 11 Nov 2024 23:24:41 -0800 Subject: [PATCH] Fix finish reason (#2013) --- python/sglang/srt/managers/schedule_batch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/managers/schedule_batch.py b/python/sglang/srt/managers/schedule_batch.py index fe75b7743..96ed7c8a8 100644 --- a/python/sglang/srt/managers/schedule_batch.py +++ b/python/sglang/srt/managers/schedule_batch.py @@ -107,12 +107,14 @@ class FINISH_LENGTH(BaseFinishReason): class FINISH_ABORT(BaseFinishReason): - def __init__(self): + def __init__(self, message="Unknown error"): super().__init__(is_error=True) + self.message = message def to_json(self): return { "type": "abort", + "message": self.message, }