Skip to contents

Function for saving models created with 'aifeducation'.

Usage

save_ai_model(
  model,
  model_dir,
  dir_name = NULL,
  save_format = "default",
  append_ID = TRUE
)

Arguments

model

Object of class TextEmbeddingClassifierNeuralNet or TextEmbeddingModel which should be saved.

model_dir

Path to the directory where the should model is stored.

dir_name

Name of the folder that will be created at model_dir. Ifdir_name=NULL the model's name will be used. If additionally append_ID=TRUE the models's name and ID will be used for generating a name for that directory.

save_format

Only relevant for TextEmbeddingClassifierNeuralNet. Format for saving the model. For 'tensorflow'/'keras' models "keras" for 'Keras v3 format', "tf" for SavedModel or "h5" for HDF5. For 'pytorch' models "safetensors" for 'safetensors' or "pt" for 'pytorch via pickle'. Use "default" for the standard format. This is keras for 'tensorflow'/'keras' models and safetensors for 'pytorch' models.

append_ID

bool TRUE if the ID should be appended to the model directory for saving purposes. FALSE if not.

Value

Function does not return a value. It saves the model to disk.

No return value, called for side effects.

See also

Other Saving and Loading: load_ai_model()