facebookresearch / hydra

Hydra is a framework for elegantly configuring complex applications
https://hydra.cc
MIT License
8.65k stars 623 forks source link

[Feature Request] Add `overrides` parameter to `@hydra.main()` #2459

Open addisonklinke opened 1 year ago

addisonklinke commented 1 year ago

🚀 Feature Request

Similar to the existing config_path and config_name parameters, add an overrides keyword argument to @hydra.main to allow hydra.main to accept either a

  1. Path to overrides.yaml serialized from a previous Hydra run
  2. ListConfig object

There should also be a corresponding --overrides CLI flag included with the Hydra-specific options

Motivation

Is your feature request related to a problem? Please describe.

Several use-cases currently require hacking sys.argv to provide overrides in a hydra.main() context. This isn't very safe or clean from a code quality perspective

Jasha10 commented 1 year ago

Thanks @addisonklinke!