Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions optimum/utils/normalized_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ def __getattr__(self, attr_name):

attr = getattr(config, leaf_attr_name, None)

if attr is None:
# See if the nested attribute has been mapped manually
try:
mapped_attr_name = super().__getattribute__(leaf_attr_name.upper())
attr = getattr(config, mapped_attr_name, None)
except AttributeError: # e.g. in the NormalizedTextAndVisionConfig case
pass

# If the attribute was not specified manually, try to fallback on the attribute_map.
if attr is None:
attribute_map = getattr(self.config, "attribute_map", {})
Expand Down