Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion torchchat/cli/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def _download_direct(
def download_and_convert(
model: str, models_dir: Path, hf_token: Optional[str] = None
) -> None:
if model is None:
raise ValueError("'download' command needs a model name or alias.")
model_config = resolve_model_config(model)
model_dir = models_dir / model_config.name

Expand Down Expand Up @@ -234,4 +236,8 @@ def where_main(args) -> None:

# Subcommand to download model artifacts.
def download_main(args) -> None:
download_and_convert(args.model, args.model_directory, args.hf_token)
try:
download_and_convert(args.model, args.model_directory, args.hf_token)
except ValueError as e:
print(e, file=sys.stderr)
sys.exit(1)
Loading