Unverified Commit 314f7176 authored by Baber Abbasi's avatar Baber Abbasi Committed by GitHub
Browse files

remove trust-remote-code in configs; fix escape sequences (#3180)

* remove trust-remote-code

* add W605 rule
parent 8c6fde08
...@@ -23,5 +23,3 @@ metric_list: ...@@ -23,5 +23,3 @@ metric_list:
higher_is_better: false higher_is_better: false
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -7,7 +7,7 @@ dataset_name: algebra ...@@ -7,7 +7,7 @@ dataset_name: algebra
output_type: generate_until output_type: generate_until
training_split: train training_split: train
test_split: test test_split: test
doc_to_text: !function utils.doc_to_text doc_to_text: !function utils.doc_to_text
process_results: !function utils.process_results process_results: !function utils.process_results
doc_to_target: "{{answer if few_shot is undefined else solution}}" doc_to_target: "{{answer if few_shot is undefined else solution}}"
generation_kwargs: generation_kwargs:
...@@ -25,8 +25,6 @@ metric_list: ...@@ -25,8 +25,6 @@ metric_list:
num_fewshot: 4 num_fewshot: 4
metadata: metadata:
version: 2.0 version: 2.0
dataset_kwargs:
trust_remote_code: true
fewshot_config: fewshot_config:
sampler: first_n sampler: first_n
samples: !function utils.list_fewshot_samples samples: !function utils.list_fewshot_samples
dataset_path: facebook/mlqa dataset_path: facebook/mlqa
dataset_kwargs:
trust_remote_code: true
test_split: test test_split: test
validation_split: validation validation_split: validation
output_type: generate_until output_type: generate_until
......
...@@ -9,5 +9,3 @@ doc_to_choice: "{{choices}}" ...@@ -9,5 +9,3 @@ doc_to_choice: "{{choices}}"
doc_to_target: "{{answer}}" doc_to_target: "{{answer}}"
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -13,5 +13,3 @@ metric_list: ...@@ -13,5 +13,3 @@ metric_list:
higher_is_better: true higher_is_better: true
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -26,5 +26,3 @@ metric_list: ...@@ -26,5 +26,3 @@ metric_list:
ignore_punctuation: true ignore_punctuation: true
metadata: metadata:
version: 2.0 version: 2.0
dataset_kwargs:
trust_remote_code: true
...@@ -34,5 +34,3 @@ metric_list: ...@@ -34,5 +34,3 @@ metric_list:
ignore_punctuation: true ignore_punctuation: true
metadata: metadata:
version: 3.0 version: 3.0
dataset_kwargs:
trust_remote_code: true
...@@ -17,7 +17,7 @@ class MultiChoiceRegexFilter(RegexFilter): ...@@ -17,7 +17,7 @@ class MultiChoiceRegexFilter(RegexFilter):
ignore_punctuation=False, ignore_punctuation=False,
regexes_to_ignore=None, regexes_to_ignore=None,
) -> None: ) -> None:
""" r"""
regex_pattern: The basic regex pattern to use. If fails to match, we will use the customized match procedure regex_pattern: The basic regex pattern to use. If fails to match, we will use the customized match procedure
- step 1 : We parse the choices between ([A-Z])s then try to find these choices in the response. - step 1 : We parse the choices between ([A-Z])s then try to find these choices in the response.
- step 2 : We parse the choice with regex :[\s]*([A-?]), where ? varies by number of choices. - step 2 : We parse the choice with regex :[\s]*([A-?]), where ? varies by number of choices.
...@@ -90,7 +90,7 @@ class MultiChoiceRegexFilter(RegexFilter): ...@@ -90,7 +90,7 @@ class MultiChoiceRegexFilter(RegexFilter):
fallback_regex = re.compile("|".join(fallback_regexes)) fallback_regex = re.compile("|".join(fallback_regexes))
without_paren_fallback_regex = "|".join(without_paren_fallback_regexes) without_paren_fallback_regex = "|".join(without_paren_fallback_regexes)
without_paren_fallback_regex = re.compile( without_paren_fallback_regex = re.compile(
f":[\s]*({without_paren_fallback_regex})" rf":[\s]*({without_paren_fallback_regex})"
) )
filtered = [] filtered = []
......
...@@ -30,5 +30,3 @@ metric_list: ...@@ -30,5 +30,3 @@ metric_list:
higher_is_better: true higher_is_better: true
metadata: metadata:
version: 3.0 version: 3.0
dataset_kwargs:
trust_remote_code: true
...@@ -17,7 +17,7 @@ class MultiChoiceRegexFilter(RegexFilter): ...@@ -17,7 +17,7 @@ class MultiChoiceRegexFilter(RegexFilter):
ignore_punctuation=False, ignore_punctuation=False,
regexes_to_ignore=None, regexes_to_ignore=None,
) -> None: ) -> None:
""" r"""
regex_pattern: The basic regex pattern to use. If fails to match, we will use the customized match procedure regex_pattern: The basic regex pattern to use. If fails to match, we will use the customized match procedure
- step 1 : We parse the choices between ([A-Z])s then try to find these choices in the response. - step 1 : We parse the choices between ([A-Z])s then try to find these choices in the response.
- step 2 : We parse the choice with regex :[\s]*([A-?]), where ? varies by number of choices. - step 2 : We parse the choice with regex :[\s]*([A-?]), where ? varies by number of choices.
...@@ -90,7 +90,7 @@ class MultiChoiceRegexFilter(RegexFilter): ...@@ -90,7 +90,7 @@ class MultiChoiceRegexFilter(RegexFilter):
fallback_regex = re.compile("|".join(fallback_regexes)) fallback_regex = re.compile("|".join(fallback_regexes))
without_paren_fallback_regex = "|".join(without_paren_fallback_regexes) without_paren_fallback_regex = "|".join(without_paren_fallback_regexes)
without_paren_fallback_regex = re.compile( without_paren_fallback_regex = re.compile(
f":[\s]*({without_paren_fallback_regex})" rf":[\s]*({without_paren_fallback_regex})"
) )
filtered = [] filtered = []
......
...@@ -13,5 +13,3 @@ metric_list: ...@@ -13,5 +13,3 @@ metric_list:
higher_is_better: true higher_is_better: true
metadata: metadata:
version: 2.0 version: 2.0
dataset_kwargs:
trust_remote_code: true
...@@ -30,5 +30,3 @@ filter_list: ...@@ -30,5 +30,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 3.0 version: 3.0
dataset_kwargs:
trust_remote_code: true
...@@ -44,7 +44,7 @@ if __name__ == "__main__": ...@@ -44,7 +44,7 @@ if __name__ == "__main__":
line = line.format(lang=lang_abbr) line = line.format(lang=lang_abbr)
if "{ans_regex}" in line: if "{ans_regex}" in line:
ans_regex = lang_lib_list[-1].replace( ans_regex = lang_lib_list[-1].replace(
"({})", "\(?([ABCDEFGHIJ])\)?" "({})", r"\(?([ABCDEFGHIJ])\)?"
) )
if lang_abbr == "en": if lang_abbr == "en":
ans_regex = ans_regex.lstrip("the").strip() ans_regex = ans_regex.lstrip("the").strip()
......
...@@ -12,5 +12,3 @@ metric_list: ...@@ -12,5 +12,3 @@ metric_list:
- metric: acc - metric: acc
metadata: metadata:
version: 0.0 version: 0.0
dataset_kwargs:
trust_remote_code: true
...@@ -12,5 +12,3 @@ metric_list: ...@@ -12,5 +12,3 @@ metric_list:
- metric: acc - metric: acc
metadata: metadata:
version: 0.0 version: 0.0
dataset_kwargs:
trust_remote_code: true
...@@ -12,5 +12,3 @@ metric_list: ...@@ -12,5 +12,3 @@ metric_list:
- metric: acc - metric: acc
metadata: metadata:
version: 0.0 version: 0.0
dataset_kwargs:
trust_remote_code: true
...@@ -23,5 +23,3 @@ metric_list: ...@@ -23,5 +23,3 @@ metric_list:
higher_is_better: true higher_is_better: true
metadata: metadata:
version: 2.0 version: 2.0
dataset_kwargs:
trust_remote_code: true
...@@ -2,8 +2,6 @@ dataset_path: Helsinki-NLP/tatoeba_mt ...@@ -2,8 +2,6 @@ dataset_path: Helsinki-NLP/tatoeba_mt
training_split: validation training_split: validation
test_split: test test_split: test
output_type: generate_until output_type: generate_until
dataset_kwargs:
trust_remote_code: true
metric_list: metric_list:
- metric: bleu - metric: bleu
higher_is_better: true higher_is_better: true
......
...@@ -19,5 +19,3 @@ metric_list: ...@@ -19,5 +19,3 @@ metric_list:
higher_is_better: true higher_is_better: true
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -23,5 +23,3 @@ metric_list: ...@@ -23,5 +23,3 @@ metric_list:
higher_is_better: true higher_is_better: true
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
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