From 5b2fcddd8920499008c03402a1b5a13d8f4f6595 Mon Sep 17 00:00:00 2001 From: Ramiro Rodriguez Colmeiro Date: Mon, 18 Nov 2024 15:37:35 -0300 Subject: [PATCH] Added regex filter for bbh fewshot --- lm_eval/tasks/bbh/fewshot/_fewshot_template_yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lm_eval/tasks/bbh/fewshot/_fewshot_template_yaml b/lm_eval/tasks/bbh/fewshot/_fewshot_template_yaml index cd59edb53d..b64adc789c 100644 --- a/lm_eval/tasks/bbh/fewshot/_fewshot_template_yaml +++ b/lm_eval/tasks/bbh/fewshot/_fewshot_template_yaml @@ -15,6 +15,20 @@ generation_kwargs: - "\n\n" do_sample: false temperature: 0.0 +filter_list: + - name: remove_whitespace + filter: + # Filter everything after the first break line + - function: "regex" + regex_pattern: "^(.*?)(?=\\n|$)" + - function: remove_whitespace + # function to ignore right white spaces or line breaks + - function: "regex" + regex_pattern: "^(.*?)\\s*$" + # If there are things between brackets, match those + - function: "regex" + regex_pattern: "\\([^()]*\\)|[^()]*" + - function: take_first num_fewshot: 3 metadata: version: 2.0