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(
110
110
def download_and_convert (
111
111
model : str , models_dir : Path , hf_token : Optional [str ] = None
112
112
) -> None :
113
+ if model is None :
114
+ raise ValueError ("'download' command needs a model name or alias." )
113
115
model_config = resolve_model_config (model )
114
116
model_dir = models_dir / model_config .name
115
117
@@ -234,4 +236,8 @@ def where_main(args) -> None:
234
236
235
237
# Subcommand to download model artifacts.
236
238
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 )
You can’t perform that action at this time.
0 commit comments