Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 08a8e03

Browse files
authored
Merge branch 'main' into refactor/distributed_inference_without_abstraction
2 parents e7670c3 + 5da240a commit 08a8e03

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

torchchat/cli/download.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def _download_direct(
110110
def download_and_convert(
111111
model: str, models_dir: Path, hf_token: Optional[str] = None
112112
) -> None:
113+
if model is None:
114+
raise ValueError("'download' command needs a model name or alias.")
113115
model_config = resolve_model_config(model)
114116
model_dir = models_dir / model_config.name
115117

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

235237
# Subcommand to download model artifacts.
236238
def download_main(args) -> None:
237-
download_and_convert(args.model, args.model_directory, args.hf_token)
239+
try:
240+
download_and_convert(args.model, args.model_directory, args.hf_token)
241+
except ValueError as e:
242+
print(e, file=sys.stderr)
243+
sys.exit(1)

0 commit comments

Comments
 (0)