Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor train.py and cfg to allow hydra tab completion #127

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tylerlum
Copy link

@tylerlum tylerlum commented Apr 10, 2023

Goal

Add Hydra tab completion for train.py to help users write commands more quickly, rather than needing to constantly check the config yaml files to remember the parameter names (eg. I kept forgetting if it was num_envs or numEnvs)

hydra_tab_completion

^ Example gif showing what the tab completion looks like

How To Use

To set up, run:

eval "$(python train.py -sc install=bash)"

Then simply type python train.py and then the tab completion will work. You can start typing a parameter name (eg. python train.py num_) and press tab to either autocomplete or show possible completions.

Low-Level Details About Changes

Relevant Screenshots from Hydra Documentation

image
^ currently using version_base 1.1, so set this explicitly

image
^ using version 1.1, so put _self_ last

image
^ add explicit override term

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant