Use raw string for regex in tokenization_t5_fast.py (#21125)

Suppress deprecation warning
This commit is contained in:
Yusuke Oda 2023-01-15 18:56:31 +09:00 committed by GitHub
parent 056218dab1
commit 15adc24208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,7 +237,7 @@ class T5TokenizerFast(PreTrainedTokenizerFast):
def get_sentinel_tokens(self):
return list(
set(filter(lambda x: bool(re.search("<extra_id_\d+>", x)) is not None, self.additional_special_tokens))
set(filter(lambda x: bool(re.search(r"<extra_id_\d+>", x)) is not None, self.additional_special_tokens))
)
def get_sentinel_token_ids(self):