save_model
- save_model(model: Model, file: Path | str | BinaryIO) None [source]
Save a model to a file.
- Parameters:
- Return type:
None
Example:
from pykeen.pipeline import pipeline from pykeen.checkpoints import save_model, load_state_torch result = pipeline(dataset="nations", model="tucker") # save model's weights to a file save_model(result.model, "/tmp/tucker.pt") # load weights again state_dict = load_state_torch("/tmp/tucket.pt") # update the model result.model.load_state_dict(state_dict)