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