Skip to content

Conversation

guptaaryan16
Copy link
Contributor

Hydra support in Code Generator

Fix #102

This PR is a continuation of python fire PR (#279) and is raised as a draft for testing now. To know more about Hydra as a tool, visit https://hydra.cc

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other
@guptaaryan16 guptaaryan16 marked this pull request as ready for review August 16, 2023 16:19
#::: } else { :::#
def main():
config = setup_config()
#::: } :::#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#::: } :::#
#::: } :::#
Copy link
Member

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to run vision classification template in colab and it fails:
image



#::: if ((it.argparser == 'fire')) { :::#
from omegaconf import DictConfig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be refactored



#::: } else if ((it.argparser == 'hydra')) { :::#
@hydra.main(version_base=None, config_path=".", config_name="config")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand how to pass backend to the config ?
Which backend is user by default ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default backend = None but if we want to send a specific backend then python main.py ++backend='gloo'

vfdev-5

This comment was marked as resolved.

@guptaaryan16
Copy link
Contributor Author

I tried to run vision classification template in colab and it fails:
image

You have to use the command python main.py as mentioned in the README.md for Hydra. If you want to pass a specific config file then it is passed like this python main.py --config-dir='' --config-name=''. Although we may need to change the colab cell output for this to work well in colab

@guptaaryan16 guptaaryan16 marked this pull request as draft August 17, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants