From c84fde8acd3608dc8304196d40692868b89990c9 Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Fri, 18 Apr 2025 18:04:51 +0800 Subject: [PATCH] Update runtime_endpoint.py --- python/sglang/lang/backend/runtime_endpoint.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/sglang/lang/backend/runtime_endpoint.py b/python/sglang/lang/backend/runtime_endpoint.py index 1cd3d5246d2..afda890a736 100644 --- a/python/sglang/lang/backend/runtime_endpoint.py +++ b/python/sglang/lang/backend/runtime_endpoint.py @@ -324,7 +324,11 @@ def _add_images(self, s: StreamExecutor, data): def _assert_success(self, res): if res.status_code != 200: - raise RuntimeError(res.json()) + try: + content = res.json() + except json.JSONDecodeError: + content = res.text + raise RuntimeError(content) def compute_normalized_prompt_logprobs(input_logprobs):