Feature Request: Arg to update models
ss32 opened this issue · 2 comments
Adding an argument to check for a newer version of the models instead of automatically skipping would be nice.
diff --git a/example_inference.py b/example_inference.py
index 746b83e..4f9412a 100644
--- a/example_inference.py
+++ b/example_inference.py
@@ -96,6 +96,7 @@ def variation(ctx, model_config: str, output_path: str, decoder_batch_size: int)
@inference.command()
@click.option('--model-config', default='./configs/upsampler.example.json', help='Path to model config file')
@click.option('--output-path', default='./output/inpaint/', help='Path to output directory')
+@click.option('--update', default=False, is_flag=True, help="Check for updates to the models and download if a newer one is found.")
@click.pass_context
def inpaint(ctx, model_config: str, output_path: str):
verbose = ctx.obj['verbose']
The checksum of the model is available in the commit to Hugging Face: example, but I don't see an obvious way of finding this programmatically to compare against a local file.
Thank you for pointing this out. I'd somehow glossed over the fact that checksums were available. I've pushed a new commit that adds the ability to specify a checksum url and introduced a small helper that automatically gets the checksum for huggingface lfs files.
You can prevent update checking by passing --suppress-updates
as a main script arg.
This should be completed, but I'll leave the ticket open until it is more tested.
I've been using the feature for a few days now and I have not had any problems.