Skip to content

Commit

Permalink
fix ignore prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Sordoni committed Jul 29, 2024
1 parent e176a50 commit 673ab4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mttl/models/containers/selectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ def from_training_config(
kwargs = {}
for key in config_klass.__dataclass_fields__.keys():
# only overwrite default if value exists and is not None
if ignore_prefix:
default_value = getattr(config_klass, ignore_prefix + key, None)
else:
default_value = None
train_cfg_value = getattr(
training_config, (ignore_prefix or "") + key, None
training_config, (ignore_prefix or "") + key, default_value
)
if train_cfg_value is not None:
kwargs[key] = train_cfg_value
Expand Down

0 comments on commit 673ab4d

Please sign in to comment.