"...git@developer.sourcefind.cn:modelzoo/qwen_lmdeploy.git" did not exist on "4c9959f6b95e20f0a4a0a45c21d168ee7b568dc9"
Unverified Commit 7cd65d49 authored by bittersweet1999's avatar bittersweet1999 Committed by GitHub
Browse files

[Fix] Fix small bug in alignbench (#764)

* fix small bugs

* fix small bugs
parent 3eb225a5
......@@ -70,7 +70,10 @@ def post_process_alignbench(judgement: str,
pattern = rf"({'|'.join(possible_keys)}): (\d+(\.\d{{1,2}})?)"
match = re.search(pattern, text)
if match:
try:
return float(match.group(1))
except ValueError:
return -1
return -1
judgement = judgement.replace('\n', '')
......
......@@ -28,8 +28,6 @@ def extract_predictions_from_json(input_folder):
# when only one complete file
print(e)
json_paths = [os.path.join(model_folder, 'alignment_bench.json')]
else:
raise FileNotFoundError
all_predictions = []
for json_ in json_paths:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment