Commit b9bf91a9 authored by Sylvain Gugger's avatar Sylvain Gugger
Browse files

Revert "Allow the same config in the auto mapping"

This reverts commit b1a7dfe0.
parent b1a7dfe0
......@@ -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())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment