Skip to content

Conversation

guptaaryan16
Copy link
Contributor

Description

Fix #102

I have added python-fire new argument parser in all templates for now. The best part is we can even over-ride the default configuration through cmd itself. For now I have just tested the templates for CPUs only.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other
@netlify
Copy link

netlify bot commented Jul 20, 2023

Deploy Preview for code-generator ready!

Name Link
🔨 Latest commit d324180
🔍 Latest deploy log https://app.netlify.com/sites/code-generator/deploys/64df69ae86d108000891b6ef
😎 Deploy Preview https://deploy-preview-279--code-generator.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vfdev-5
Copy link
Member

vfdev-5 commented Jul 26, 2023

Thanks for the PR @guptaaryan16
General remarks:

  • fire should be an option and not a replacement, so we have to add a checkbox to the UI
  • a suggestion let's introduce DotDict in another PR and put returned config as DotDict instead of argparser namespace - another option is to transform dict config into argparser namespace ?
@guptaaryan16 guptaaryan16 marked this pull request as draft July 28, 2023 20:29
@vfdev-5
Copy link
Member

vfdev-5 commented Aug 17, 2023

Omegaconf is missing in vision classification template
image

Why CI tests are not triggering this error ?

@guptaaryan16
Copy link
Contributor Author

Why CI tests are not triggering this error ?

Because in CI the templates use pre-installed libraries present in scripts/requirements.txt and so we can't seem to detect this error from there

@vfdev-5
Copy link
Member

vfdev-5 commented Aug 17, 2023

Another issue with argparse option selected
image

once again why CI does not raise this error ?

@guptaaryan16
Copy link
Contributor Author

guptaaryan16 commented Aug 17, 2023

once again why CI does not raise this error ?

This is a fix @theory-in-progress is working on. Basically unless you click on all options the templates does not seem to load the options by default. I have covered this in tests and so CI doesn't raise this issue


def save_config(config):
"""Save configuration to config-lock.yaml for result reproducibility."""
with open(f"{config.output_dir}/config-lock.yaml", "a+") as f:
Copy link
Member

Choose a reason for hiding this comment

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

why it is "a+" mode and not "w" ?

return Path(idist.broadcast(config.output_dir, src=0))


def save_config(config):
Copy link
Member

Choose a reason for hiding this comment

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

let's make it more generic with output_dir parameter:

def save_config(config: Any, output_dir: str): 
def save_config(config):
"""Save configuration to config-lock.yaml for result reproducibility."""
with open(f"{config.output_dir}/config-lock.yaml", "a+") as f:
with open(f"{config.output_dir}/config-lock.yaml", "w+") as f:
Copy link
Member

Choose a reason for hiding this comment

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

why "w+" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants