From 32aad3e6516806410b7144dd10bfba4b3c40dc64 Mon Sep 17 00:00:00 2001 From: Ben Athiwaratkun Date: Mon, 5 Jun 2023 18:05:49 -0400 Subject: [PATCH] Allow passing problems (dict) directly --- mxeval/evaluation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mxeval/evaluation.py b/mxeval/evaluation.py index 23fe105..9ca84e9 100644 --- a/mxeval/evaluation.py +++ b/mxeval/evaluation.py @@ -91,7 +91,11 @@ def evaluate_functional_correctness( results to f"{sample_file}_results.jsonl" """ - problems = read_problems(problem_file) + if type(problem_file) is not dict: + problems = read_problems(problem_file) + else: + print("Skip reading problems -- using problem_file (dict) as problems") + problems = problem_file # see execution.py for details # Check the generated samples against test suites.