From 8d2f64c1da7d60c47b46076b11978dc8eb1b0a89 Mon Sep 17 00:00:00 2001 From: Baber Abbasi <92168766+baberabb@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:43:33 +0000 Subject: [PATCH] fix `DeprecationWarning: invalid escape sequence '\s'` for whitespace filter (#2560) * fix `DeprecationWarning: invalid escape sequence '\s'` * add type hints * Revert "add type hints" This reverts commit 15d8abc626a84e97f8c238ddfbf9e243d6f6eb5c. --- lm_eval/filters/extraction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lm_eval/filters/extraction.py b/lm_eval/filters/extraction.py index 5dc10863e7..58312e99d3 100644 --- a/lm_eval/filters/extraction.py +++ b/lm_eval/filters/extraction.py @@ -164,7 +164,7 @@ def filter_ignores(st): fallback_regex = re.compile("|".join(fallback_regexes)) without_paren_fallback_regex = "|".join(without_paren_fallback_regexes) without_paren_fallback_regex = re.compile( - f":[\s]*({without_paren_fallback_regex})" + rf":[\s]*({without_paren_fallback_regex})" ) filtered = []