INNER CODE UNIT · Python
save_pretrained
Leeroo-AI/mergoo · mergoo/safe_saving.py:21
def save_pretrained(
save_directory,
state_dict,
is_main_process=True,
save_function=torch.save,
max_shard_size="4GB",
safe_serialization: bool = True,
variant=None,
tied_weights_keys=None,
_keys_to_ignore_on_save=None,
**kwargs,
):
"""
Save a model and its configuration file to a directory, so that it can be re-loaded using the
[`~PreTrainedModel.from_pretrained`] class method.
Arguments:
save_directory (`str` or `os.PathLike`):