From 1a2b0ef1622fdb3c2ff9e42522b3faf20afd135e Mon Sep 17 00:00:00 2001 From: venkatram-dev Date: Tue, 7 Oct 2025 15:33:34 -0700 Subject: [PATCH] Fix: add -m/--model option for solo download while keeping positional support (#44) --- solo_server/commands/download_hf.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/solo_server/commands/download_hf.py b/solo_server/commands/download_hf.py index 6bc5023..b7fda9c 100644 --- a/solo_server/commands/download_hf.py +++ b/solo_server/commands/download_hf.py @@ -8,10 +8,20 @@ console = Console() -def download(model: str) -> None: +def download( + model_arg: str = typer.Argument(None, help="Model name or repo ID (positional)"), + model_opt: str = typer.Option(None, "--model", "-m", help="Model name or repo ID (option)"), +) -> None: """ Downloads a Hugging Face model using the huggingface repo id. """ + # Prefer the option if provided, otherwise fallback to positional + model = model_opt or model_arg + + if not model: + console.print("❌ Please provide a model name (e.g., -m meta-llama/Llama-3.2-1B-Instruct)", style="bold red") + raise typer.Exit(code=1) + console.print(f"🚀 Downloading model: [bold]{model}[/bold]...") try: model_path = snapshot_download(repo_id=model)