Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Fix] Fix Executable Exact Match Condition Did not Meet #251

Merged
merged 3 commits into from
Mar 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def convert_to_function_call(data_str):
execution_result_type = testing_data[i]["execution_result_type"]
if type(execution_result_type) is str and len(execution_result) > 1:
execution_result_type = [execution_result_type] * len(execution_result)
elif type(execution_result_type) is str and len(execution_result) == 1:
execution_result_type = [execution_result_type]
if ("gpt" in model_name or "fire" in model_name or "mistral-large-latest" in model_name or "gemini" in model_name) and input_file is None:
try:
result = convert_to_function_call(result_data[i]["result"])
Expand Down Expand Up @@ -239,7 +241,7 @@ def convert_to_function_call(data_str):
if len(result) != len(execution_result):
total += 1
continue
for function_call, exec_result in zip(result, execution_result):
for function_call, exec_result, exec_type in zip(result, execution_result, execution_result_type):
try:
exec(
"from data.function.gorilla_openfunctions_v1_test_function import *"
Expand All @@ -252,7 +254,7 @@ def convert_to_function_call(data_str):
test_result_list.append(False)
reason_list.append(str(e))
continue
if execution_result_type == "exact_match":
if exec_type == "exact_match":
test_result_list.append(output == exec_result or [output] == exec_result)
else:
try:
Expand Down