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
...@@ -111,7 +111,7 @@ def parse_math_answer(raw_string): ...@@ -111,7 +111,7 @@ def parse_math_answer(raw_string):
return retval return retval
def get_answer_with_dollar_sign(s): def get_answer_with_dollar_sign(s):
first_pattern = "\$(.*)\$" first_pattern = r"\$(.*)\$"
last_match = None last_match = None
matches = re.findall(first_pattern, s) matches = re.findall(first_pattern, s)
if matches: if matches:
...@@ -127,7 +127,7 @@ def parse_math_answer(raw_string): ...@@ -127,7 +127,7 @@ def parse_math_answer(raw_string):
if "\\n" in last_match: if "\\n" in last_match:
last_match = last_match.split("\\n")[0] last_match = last_match.split("\\n")[0]
else: else:
pattern = "(?:\\$)?\d+(?:\.\d+)?(?![\w\d])" pattern = "(?:\\$)?\\d+(?:\\.\\d+)?(?![\\w\\d])"
matches = re.findall(pattern, s) matches = re.findall(pattern, s)
if matches: if matches:
last_match = matches[-1] last_match = matches[-1]
...@@ -250,7 +250,7 @@ def _strip_string(string): ...@@ -250,7 +250,7 @@ def _strip_string(string):
# remove percentage # remove percentage
string = string.replace("\\%", "") string = string.replace("\\%", "")
string = string.replace("\%", "") string = string.replace(r"\%", "")
# " 0." equivalent to " ." and "{0." equivalent to "{." Alternatively, add "0" if "." is the start of the string # " 0." equivalent to " ." and "{0." equivalent to "{." Alternatively, add "0" if "." is the start of the string
string = string.replace(" .", " 0.") string = string.replace(" .", " 0.")
......
...@@ -111,7 +111,7 @@ def parse_math_answer(raw_string): ...@@ -111,7 +111,7 @@ def parse_math_answer(raw_string):
return retval return retval
def get_answer_with_dollar_sign(s): def get_answer_with_dollar_sign(s):
first_pattern = "\$(.*)\$" first_pattern = r"\$(.*)\$"
last_match = None last_match = None
matches = re.findall(first_pattern, s) matches = re.findall(first_pattern, s)
if matches: if matches:
...@@ -127,7 +127,7 @@ def parse_math_answer(raw_string): ...@@ -127,7 +127,7 @@ def parse_math_answer(raw_string):
if "\\n" in last_match: if "\\n" in last_match:
last_match = last_match.split("\\n")[0] last_match = last_match.split("\\n")[0]
else: else:
pattern = "(?:\\$)?\d+(?:\.\d+)?(?![\w\d])" pattern = "(?:\\$)?\\d+(?:\\.\\d+)?(?![\\w\\d])"
matches = re.findall(pattern, s) matches = re.findall(pattern, s)
if matches: if matches:
last_match = matches[-1] last_match = matches[-1]
...@@ -250,7 +250,7 @@ def _strip_string(string): ...@@ -250,7 +250,7 @@ def _strip_string(string):
# remove percentage # remove percentage
string = string.replace("\\%", "") string = string.replace("\\%", "")
string = string.replace("\%", "") string = string.replace(r"\%", "")
# " 0." equivalent to " ." and "{0." equivalent to "{." Alternatively, add "0" if "." is the start of the string # " 0." equivalent to " ." and "{0." equivalent to "{." Alternatively, add "0" if "." is the start of the string
string = string.replace(" .", " 0.") string = string.replace(" .", " 0.")
......
...@@ -14,7 +14,5 @@ metric_list: ...@@ -14,7 +14,5 @@ metric_list:
- metric: acc_norm - metric: acc_norm
aggregation: mean aggregation: mean
higher_is_better: true higher_is_better: true
dataset_kwargs:
trust_remote_code: true
metadata: metadata:
version: 0 version: 0
...@@ -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
...@@ -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
...@@ -29,5 +29,3 @@ generation_kwargs: ...@@ -29,5 +29,3 @@ generation_kwargs:
max_gen_toks: 1024 max_gen_toks: 1024
metadata: metadata:
version: 2.0 version: 2.0
dataset_kwargs:
trust_remote_code: true
...@@ -18,5 +18,3 @@ metric_list: ...@@ -18,5 +18,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
...@@ -22,8 +22,6 @@ metric_list: ...@@ -22,8 +22,6 @@ metric_list:
num_fewshot: 4 num_fewshot: 4
metadata: metadata:
version: 3.0 version: 3.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
...@@ -29,5 +29,3 @@ filter_list: ...@@ -29,5 +29,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -23,6 +23,4 @@ metric_list: ...@@ -23,6 +23,4 @@ metric_list:
ignore_punctuation: true ignore_punctuation: true
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
num_fewshot: 0 num_fewshot: 0
...@@ -28,5 +28,3 @@ filter_list: ...@@ -28,5 +28,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -28,5 +28,3 @@ filter_list: ...@@ -28,5 +28,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -28,5 +28,3 @@ filter_list: ...@@ -28,5 +28,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -28,5 +28,3 @@ filter_list: ...@@ -28,5 +28,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -28,5 +28,3 @@ filter_list: ...@@ -28,5 +28,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -31,5 +31,3 @@ filter_list: ...@@ -31,5 +31,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -28,5 +28,3 @@ filter_list: ...@@ -28,5 +28,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: true
...@@ -28,5 +28,3 @@ filter_list: ...@@ -28,5 +28,3 @@ filter_list:
- function: take_first - function: take_first
metadata: metadata:
version: 1.0 version: 1.0
dataset_kwargs:
trust_remote_code: 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
...@@ -25,5 +25,3 @@ filter_list: ...@@ -25,5 +25,3 @@ filter_list:
- function: "take_first" - function: "take_first"
metadata: metadata:
version: 0.0 version: 0.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