From 102c1c112f0142e00f8d6e71139e2a1aa41295a8 Mon Sep 17 00:00:00 2001 From: Donald Lam Date: Thu, 5 Sep 2024 18:06:15 +0800 Subject: [PATCH] update the mechanism for wrong responses --- server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 4a3b276..35f93e0 100644 --- a/server.py +++ b/server.py @@ -169,8 +169,9 @@ def start_request(self, scale_details, level_description, statement_description, gpt_responses = llm_request(self.model, inputs) parsed_responses = json.loads(gpt_responses) parsed_responses = [convert_symbol(label, value) for value in parsed_responses.values()] - if order == 'r': - parsed_responses = [scale_max-score+1 for score in parsed_responses] + + if None in parsed_responses: return None + if order == 'r': parsed_responses = [scale_max-score+1 for score in parsed_responses] except: return None