-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add support for overriding inputs via CLI args #31
Conversation
valohai/utils.py
Outdated
if "://" not in value and os.path.isfile(value): # The string is a local path | ||
files.append(FileInfo(name=os.path.basename(value), uri=None, path=value, size=None, checksums=None)) | ||
else: # The string is an URI | ||
files.append(FileInfo(name=FileInfo.uri_to_filename(value), uri=value, path=None, size=None, checksums=None)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the reason uri_to_filename
feels like it should be a free function...
valohai/utils.py
Outdated
inputs = {k: v for k, v in vars(args).items() if k in names} | ||
for name, values in inputs.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe simpler put as
inputs = {k: v for k, v in vars(args).items() if k in names} | |
for name, values in inputs.items(): | |
for name, values in vars(args).items(): | |
if name not in names: | |
continue |
valohai/utils.py
Outdated
parameters = {k: v for k, v in vars(args).items() if k in names} | ||
for name, value in parameters.items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameters = {k: v for k, v in vars(args).items() if k in names} | |
for name, value in parameters.items(): | |
for name, value in vars(args).items(): | |
if name not in names: | |
continue |
You can locally override only the parameters through the CLI currently. For example:
python train.py --lr=0.001
In Valohai CLI & UI you can also override inputs. We need to have that from valohai-utils too. For example:
python train.py --images=/tmp/lol/*.png
This PR makes that possible.