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
b4919cb5
Unverified
Commit
b4919cb5
authored
Jun 05, 2023
by
Bearnardd
Committed by
GitHub
Jun 05, 2023
Browse files
Auto tokenizer registration (#23965)
add check loop over extra content
parent
b1430190
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/transformers/models/auto/configuration_auto.py
src/transformers/models/auto/configuration_auto.py
+4
-0
No files found.
src/transformers/models/auto/configuration_auto.py
View file @
b4919cb5
...
...
@@ -645,6 +645,10 @@ def config_class_to_model_type(config):
for
key
,
cls
in
CONFIG_MAPPING_NAMES
.
items
():
if
cls
==
config
:
return
key
# if key not found check in extra content
for
key
,
cls
in
CONFIG_MAPPING
.
_extra_content
.
items
():
if
cls
.
__name__
==
config
:
return
key
return
None
...
...
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