replace_tensors¶ onnx_safetensors.replace_tensors(model, /, location, base_dir)[source]¶ Replace weights in an ONNX model with those of the same names found in the safetensors file. The weights will be represented as ‘external data’ references in onnx TensorProto. Added in version 1.0: Added the function. Parameters: model (Model) – ONNX model to replace tensors in. location (str | PathLike) – Path to the safetensors file relative to the ONNX model file. base_dir (str | PathLike) – Directory where the ONNX model file is stored. Return type: None