API: Persistence
Fiducio saves a single torch.save payload containing format metadata, the
Fiducio version, a stable calibrator id, the constructor configuration and the
learned state. Loading resolves the id through an internal controlled
registry and never imports an arbitrary module path stored in the file. By
default files are read with weights_only=True and onto CPU.
Warning
Only load calibrator files from sources you trust. See the project security policy.
save_calibrator
Serialize calibrator to path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
calibrator
|
Any
|
A fitted (or at least constructed) :class: |
required |
path
|
PathLike
|
Destination file. The |
required |
Source code in src/fiducio/persistence.py
load_calibrator
Load a calibrator previously written by :func:save_calibrator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
PathLike
|
File to load. |
required |
map_location
|
MapLocation | None
|
Device for the loaded tensors and the reconstructed calibrator. Defaults
to |
'cpu'
|
Notes
The payload is read exclusively with weights_only=True, which restricts
deserialization to tensors and basic Python types. Only load files you trust.