Function for saving models created with 'aifeducation'.
save_ai_model(
model,
model_dir,
dir_name = NULL,
save_format = "default",
append_ID = TRUE
)
Function does not return a value. It saves the model to disk.
No return value, called for side effects.
Object of class TextEmbeddingClassifierNeuralNet or TextEmbeddingModel which should be saved.
Path to the directory where the should model is stored.
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.
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.
bool
TRUE
if the ID should be appended to
the model directory for saving purposes. FALSE
if not.
Other Saving and Loading:
load_ai_model()