Skip to content

Commit

Permalink
Added regex filter for bbh fewshot
Browse files Browse the repository at this point in the history
  • Loading branch information
RawthiL committed Nov 18, 2024
1 parent 62b4364 commit 5b2fcdd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lm_eval/tasks/bbh/fewshot/_fewshot_template_yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5b2fcdd

Please sign in to comment.