Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
15adc242
Unverified
Commit
15adc242
authored
Jan 15, 2023
by
Yusuke Oda
Committed by
GitHub
Jan 15, 2023
Browse files
Use raw string for regex in tokenization_t5_fast.py (#21125)
Suppress deprecation warning
parent
056218da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/t5/tokenization_t5_fast.py
src/transformers/models/t5/tokenization_t5_fast.py
+1
-1
No files found.
src/transformers/models/t5/tokenization_t5_fast.py
View file @
15adc242
...
@@ -237,7 +237,7 @@ class T5TokenizerFast(PreTrainedTokenizerFast):
...
@@ -237,7 +237,7 @@ class T5TokenizerFast(PreTrainedTokenizerFast):
def
get_sentinel_tokens
(
self
):
def
get_sentinel_tokens
(
self
):
return
list
(
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
):
def
get_sentinel_token_ids
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment