"vscode:/vscode.git/clone" did not exist on "ef176d29dffe5fb9f962d5d8c2aa8dcfb7ba2464"
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): ...@@ -389,13 +389,7 @@ class _LazyConfigMapping(OrderedDict):
module_name = model_type_to_module_name(key) module_name = model_type_to_module_name(key)
if module_name not in self._modules: if module_name not in self._modules:
self._modules[module_name] = importlib.import_module(f".{module_name}", "transformers.models") 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)
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)
def keys(self): def keys(self):
return list(self._mapping.keys()) + list(self._extra_content.keys()) 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