From 1c092538ef6b7a35daf323747a5304ed2b69db75 Mon Sep 17 00:00:00 2001 From: FangYin Cheng Date: Thu, 28 Sep 2023 14:38:00 +0800 Subject: [PATCH] chore: Roll back json parsing code --- pilot/scene/chat_dashboard/out_parser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pilot/scene/chat_dashboard/out_parser.py b/pilot/scene/chat_dashboard/out_parser.py index bf6c517fb..d593333e5 100644 --- a/pilot/scene/chat_dashboard/out_parser.py +++ b/pilot/scene/chat_dashboard/out_parser.py @@ -21,9 +21,9 @@ def __init__(self, sep: str, is_stream_out: bool): super().__init__(sep=sep, is_stream_out=is_stream_out) def parse_prompt_response(self, model_out_text): - # clean_str = super().parse_prompt_response(model_out_text) - print("clean prompt response:", model_out_text) - response = json.loads(model_out_text) + clean_str = super().parse_prompt_response(model_out_text) + print("clean prompt response:", clean_str) + response = json.loads(clean_str) chart_items: List[ChartItem] = [] if not isinstance(response, list): response = [response]