@@ -62,26 +62,17 @@ def ping() -> None:
6262)
6363def download_model (model_uri : str , output : Path ) -> None :
6464 """Download a model from HuggingFace and save as zip file."""
65- try :
66- model_class = get_model_class (model_uri )
67- except ValueError as e :
68- logger .exception ("Unknown model URI: %s" , model_uri )
69- raise click .ClickException (str (e )) from e
70-
71- logger .info ("Downloading model: %s" , model_uri )
65+ # load embedding model class
66+ model_class = get_model_class (model_uri )
7267 model = model_class (model_uri )
7368
74- try :
75- result_path = model .download (output )
76- logger .info ("Model downloaded successfully to: %s" , result_path )
77- click .echo (f"Model saved to: { result_path } " )
78- except NotImplementedError as e :
79- logger .exception ("Download not yet implemented for model: %s" , model_uri )
80- raise click .ClickException (str (e )) from e
81- except Exception as e :
82- logger .exception ("Failed to download model: %s" , model_uri )
83- msg = f"Download failed: { e } "
84- raise click .ClickException (msg ) from e
69+ # download model assets
70+ logger .info (f"Downloading model: { model_uri } " )
71+ result_path = model .download (output )
72+
73+ message = f"Model downloaded and saved to: { result_path } "
74+ logger .info (message )
75+ click .echo (result_path )
8576
8677
8778@main .command ()
@@ -90,9 +81,8 @@ def download_model(model_uri: str, output: Path) -> None:
9081 required = True ,
9182 help = "HuggingFace model URI (e.g., 'org/model-name')" ,
9283)
93- def create_embeddings (model_uri : str ) -> None :
94- """Create embeddings."""
95- logger .info ("create-embeddings command called with model: %s" , model_uri )
84+ def create_embeddings (_model_uri : str ) -> None :
85+ # TODO: docstring # noqa: FIX002
9686 raise NotImplementedError
9787
9888
0 commit comments