File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,8 @@ def _download_direct(
110110def 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.
236238def 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 )
You can’t perform that action at this time.
0 commit comments