tinker_cookbook.weights.download
Generated from tinker-cookbook at commit 1991897. Source links point at that snapshot.
tinker_cookbook.weights.download(tinker_path, output_dir, base_url)
Download a checkpoint from Tinker storage to local disk.
The path type selects how the files are fetched:
-
tinker://<run_id>/external_weights/<name>, as returned byTrainingClient.save_weights_external(): each file is downloaded from its own signed URL intooutput_dir. Files of an age-encrypted export keep their.agesuffix; decrypt them withage -dbefore you use them. -
tinker://<run_id>/weights/<name>, as returned byTrainingClient.save_state(): the checkpoint is loaded into a new training run and saved withsave_weights_external(), encrypted to a key generated for this download. The files are downloaded and decrypted, and then the export is deleted. This starts a training session on the checkpoint's base model.
Sampler checkpoints (tinker://<run_id>/sampler_weights/<name>) cannot
be downloaded. Save a training checkpoint or external weights instead.
File paths are validated before they are written (rejects path traversal).
Parameters:
- tinker_path (str) – Tinker checkpoint path (see above).
- output_dir (str) – Local directory where the checkpoint files are written.
- base_url (str | None) – Custom Tinker service URL. If
None(default), uses the default Tinker service endpoint (orTINKER_BASE_URLenvironment variable if set).
Returns: output_dir.
Raises:
- WeightsDownloadError: If the path is invalid, the service cannot be
- reached, a checkpoint cannot be exported, a file fails to download or decrypt, or a
- file path is unsafe.