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

Added regex filter for bbh fewshot #2502

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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