SentenceTransformerModel.zip_model

opensearch_py_ml.ml_models.SentenceTransformerModel.zip_model(self, model_path: str | None = None, model_name: str | None = None, zip_file_name: str | None = None, add_apache_license: bool = False, verbose: bool = False) None

Zip the model file and its tokenizer.json file to prepare to upload to the OpenSearch cluster

Parameters:
  • model_path (string) – Optional, path to find the model file, if None, default as concatenate model_id and ‘.pt’ file in current path

  • model_name (string) – the name of the trained custom model. If None, default as concatenate model_id and ‘.pt’

  • zip_file_name (string) – str =None Optional, file name for zip file. if None, default as concatenate model_id and ‘.zip’

  • add_apache_license (string) – Optional, whether to add a Apache-2.0 license file to model zip file

  • verbose (bool) – optional, use to print more logs. Default as false

Returns:

no return value expected

Return type:

None