From 4cb43443d2f3d7590f05689dd19764b5cc18901d Mon Sep 17 00:00:00 2001 From: Xingjian Shi Date: Thu, 8 Feb 2024 13:30:41 -0800 Subject: [PATCH] Fix loading PAL-GSM few-shot samples --- bigcode_eval/tasks/gsm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bigcode_eval/tasks/gsm.py b/bigcode_eval/tasks/gsm.py index 13e557786..a36b22f69 100644 --- a/bigcode_eval/tasks/gsm.py +++ b/bigcode_eval/tasks/gsm.py @@ -39,6 +39,7 @@ # Number of few shot examples to consider NUM_SHOTS = 8 +_CURR_DIR = os.path.dirname(os.path.abspath(__file__)) class EvaluationType(str, Enum): """Possible values for evaluation type argument""" @@ -105,7 +106,7 @@ def get_dataset(self): def fewshot_examples(self): """Loads and returns the few-shot examples for the task if they exist.""" with open( - "bigcode_eval/tasks/few_shot_examples/gsm8k_few_shot_prompts.json", + os.path.join(_CURR_DIR, "few_shot_examples/gsm8k_few_shot_prompts.json"), "r", ) as file: examples = json.load(file)