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
b9bf91a9
Commit
b9bf91a9
authored
Apr 06, 2022
by
Sylvain Gugger
Browse files
Revert "Allow the same config in the auto mapping"
This reverts commit
b1a7dfe0
.
parent
b1a7dfe0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
7 deletions
+1
-7
src/transformers/models/auto/configuration_auto.py
src/transformers/models/auto/configuration_auto.py
+1
-7
No files found.
src/transformers/models/auto/configuration_auto.py
View file @
b9bf91a9
...
...
@@ -389,13 +389,7 @@ class _LazyConfigMapping(OrderedDict):
module_name
=
model_type_to_module_name
(
key
)
if
module_name
not
in
self
.
_modules
:
self
.
_modules
[
module_name
]
=
importlib
.
import_module
(
f
".
{
module_name
}
"
,
"transformers.models"
)
if
hasattr
(
self
.
_modules
[
module_name
],
value
):
return
getattr
(
self
.
_modules
[
module_name
],
value
)
# Some of the mappings have entries model_type -> config of another model type. In that case we try to grab the
# object at the top level.
transformers_module
=
importlib
.
import_module
(
"transformers"
)
return
getattr
(
transformers_module
,
value
)
return
getattr
(
self
.
_modules
[
module_name
],
value
)
def
keys
(
self
):
return
list
(
self
.
_mapping
.
keys
())
+
list
(
self
.
_extra_content
.
keys
())
...
...
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