Skip to content

Offline and on-premises use

synapse-sr never needs the network for processing. The only network access is the one-time download of the weights by Pro.from_pretrained(), and that is skipped when you pass a local file.

Air-gapped machines

  1. On a connected machine, download the checkpoint from Hugging Face and build a wheelhouse:

    pip download synapse-sr -d wheelhouse
    
  2. Copy wheelhouse/ and the .safetensors file to the target machine, then:

    pip install --no-index --find-links wheelhouse synapse-sr
    synapse-sr scene.tif scene_2m.tif --weights /opt/models/synapse-pro-v2.safetensors
    
import synapse_sr

from synapse_sr import Pro
model = Pro.from_pretrained(weights="/opt/models/synapse-pro-v2.safetensors")

Cache

Downloaded weights are stored in ~/.cache/synapse, or in $SYNAPSE_CACHE if set. They are verified by SHA-256 on every load (the hash is remembered in a .sha256 file next to the checkpoint and recomputed whenever the file changes). A corrupted or tampered file raises an error that names the expected and actual hashes.

An interrupted download is retried up to four times and resumes where it stopped; the partial .part file is kept, so the next run continues it.

Situation Setting
Hugging Face blocked, a mirror is reachable HF_ENDPOINT=https://hf-mirror.com
Never touch the network SYNAPSE_OFFLINE=1 (or HF_HUB_OFFLINE=1): a checkpoint that is not cached raises instead of downloading

Your own checkpoints

from synapse_sr import Pro
model = Pro.from_pretrained()

model.save_pretrained("my-model.safetensors")         # model + sensor operator in one file
Pro.from_pretrained(weights="my-model.safetensors")