Skip to content

Commit

Permalink
fix: enable mutiple config overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoYinYing committed Aug 20, 2024
1 parent d7bd9ee commit 96a3de8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ preset:

# Other configurations
other:
maxit_binary: /mnt/data/yinying/software/maxit/maxit-v11.100-prod-src/bin/maxit # Corresponds to --maxit_binary
maxit_binary: /mnt/data/software/maxit/maxit-v11.100-prod-src/bin/maxit # Corresponds to --maxit_binary


# CONFIG_DIFFS for advanced configuration
Expand Down
11 changes: 7 additions & 4 deletions apps/protein_folding/helixfold3/helixfold/model/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ def model_config(config_diffs: Union[str, DictConfig, dict[str, dict[str, Any]]]
cfg.merge_with_dotlist(updated_config)
print(f'Updated config from `CONFIG_DIFFS.{preset_name}`: {updated_config}')

return cfg

# update from detailed configuration
if any(root_kw in config_diffs for root_kw in CONFIG_ALLATOM):

cfg.merge_with(config_diffs) # merge to override
print(f'Updated config from `CONFIG_DIFFS`: {config_diffs}')
return cfg
for root_kw in CONFIG_ALLATOM:
if root_kw not in config_diffs:
continue
cfg.merge_with(DictConfig({root_kw:config_diffs[root_kw]})) # merge to override
print(f'Updated config from `CONFIG_DIFFS`:{root_kw}: {config_diffs[root_kw]}')

return cfg

raise ValueError(f'Invalid config_diffs ({type(config_diffs)}): {config_diffs}')

Expand Down

0 comments on commit 96a3de8

Please sign in to comment.