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

Fix Typos in Evaluation Script and System Prompt. Identify Errors in a Dataset #335

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
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
@@ -1,4 +1,4 @@
SYSTEM_PROMPT_FOR_CHAT_MODEL = """"
SYSTEM_PROMPT_FOR_CHAT_MODEL = """
You are an expert in composing functions. You are given a question and a set of possible functions.
Based on the question, you will need to make one or more function/tool calls to achieve the purpose.
If none of the function can be used, point it out. If the given question lacks the parameters required by the function,
Expand Down
13 changes: 6 additions & 7 deletions berkeley-function-call-leaderboard/openfunctions_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,22 @@ def get_args():
"sql": "gorilla_openfunctions_v1_test_sql.json",
}

def build_handler(model_name):
handler = handler_map[model_name](model_name, args.temperature, args.top_p, args.max_tokens)
def build_handler(model_name, temperature, top_p, max_tokens):
handler = handler_map[model_name](model_name, temperature, top_p, max_tokens)
return handler

def load_file(test_category):
if args.test_category == "all":
if test_category == "all":
test_cate,files_to_open = list(test_categories.keys()),list(test_categories.values())
else:
test_cate,files_to_open = [args.test_category], [test_categories[args.test_category]]
test_cate,files_to_open = [test_category], [test_categories[test_category]]
return test_cate,files_to_open

if __name__ == "__main__":
args = get_args()
model = args.model
handler = build_handler(args.model)
handler = build_handler(args.model, args.temperature, args.top_p, args.max_tokens)
if handler.model_style == ModelStyle.OSSMODEL:
result = handler.inference(question_file="eval_data_total.json",test_categories=args.test_categories,num_gpus=args.num_gpus)
result = handler.inference(question_file="eval_data_total.json",test_category=args.test_category,num_gpus=args.num_gpus)
for res in result[0]:
handler.write(res, "result.json")
else:
Expand Down