save_safetensors_model

onnx_safetensors.save_safetensors_model(model, safetensors_model_path)[source]

Save an ONNX model to a safetensors file.

This function will embed the onnx model into a safetensors file. This file is not compatible with onnx runtime, and is only useful for storage or transfer.

Added in version 1.5.0: Added the function.

Parameters:
  • model (TModel) – ONNX model to save.

  • safetensors_model_path (str | PathLike) – Path to the safetensors model file.