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
eb3479e7
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "34ccc8ebf4c9e440e4621dab6cdb0a8f2dc903ad"
Unverified
Commit
eb3479e7
authored
Apr 05, 2021
by
Lysandre Debut
Committed by
GitHub
Apr 05, 2021
Browse files
Some models have no tokenizers (#11064)
parent
773e4c72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
tests/test_tokenization_common.py
tests/test_tokenization_common.py
+8
-7
No files found.
tests/test_tokenization_common.py
View file @
eb3479e7
...
@@ -69,13 +69,14 @@ def merge_model_tokenizer_mappings(
...
@@ -69,13 +69,14 @@ def merge_model_tokenizer_mappings(
model_tokenizer_mapping
=
OrderedDict
([])
model_tokenizer_mapping
=
OrderedDict
([])
for
configuration
in
configurations
:
for
configuration
in
configurations
:
model
=
model_mapping
[
configuration
]
if
configuration
in
model_mapping
and
configuration
in
tokenizer_mapping
:
tokenizer
=
tokenizer_mapping
[
configuration
][
0
]
model
=
model_mapping
[
configuration
]
tokenizer_fast
=
tokenizer_mapping
[
configuration
][
1
]
tokenizer
=
tokenizer_mapping
[
configuration
][
0
]
tokenizer_fast
=
tokenizer_mapping
[
configuration
][
1
]
model_tokenizer_mapping
.
update
({
tokenizer
:
(
configuration
,
model
)})
if
tokenizer_fast
is
not
None
:
model_tokenizer_mapping
.
update
({
tokenizer
:
(
configuration
,
model
)})
model_tokenizer_mapping
.
update
({
tokenizer_fast
:
(
configuration
,
model
)})
if
tokenizer_fast
is
not
None
:
model_tokenizer_mapping
.
update
({
tokenizer_fast
:
(
configuration
,
model
)})
return
model_tokenizer_mapping
return
model_tokenizer_mapping
...
...
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