Unverified Commit 325f168c authored by lxning's avatar lxning Committed by GitHub
Browse files

fix the regex string in mmlu_pro template (#2238)



* fix the regex string in yaml file

* Update samplers.py

---------
Co-authored-by: default avatarLintang Sutawika <lintang@eleuther.ai>
parent a4987bba
...@@ -82,8 +82,9 @@ class ContextSampler: ...@@ -82,8 +82,9 @@ class ContextSampler:
if self.config.doc_to_choice is None or isinstance(doc_content, str) if self.config.doc_to_choice is None or isinstance(doc_content, str)
else self.doc_to_choice(doc)[doc_content] else self.doc_to_choice(doc)[doc_content]
) )
labeled_examples += self.target_delimiter
if doc_target != "": if doc_target != "":
labeled_examples += self.target_delimiter
labeled_examples += ( labeled_examples += (
str(doc_target[0]) str(doc_target[0])
if isinstance(doc_target, list) if isinstance(doc_target, list)
......
...@@ -12,7 +12,7 @@ filter_list: ...@@ -12,7 +12,7 @@ filter_list:
- name: "custom-extract" - name: "custom-extract"
filter: filter:
- function: "regex" - function: "regex"
regex_pattern: r"answer is \(?([ABCDEFGHIJ])\)?" regex_pattern: 'answer is \(?([ABCDEFGHIJ])\)?'
# regex_pattern: r".*[aA]nswer:\s*([A-J])", # regex_pattern: r".*[aA]nswer:\s*([A-J])",
- function: "take_first" - function: "take_first"
generation_kwargs: generation_kwargs:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment