Skip to content

Fix sampler_weights checkpoint loading#32

Open
Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Jah-yee:pr-sampler-weights
Open

Fix sampler_weights checkpoint loading#32
Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Jah-yee:pr-sampler-weights

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 15, 2026

Summary

Fixes Issue #25: sampler_weights not available while weights is available

Problem

When loading a sampler_weights checkpoint using a tinker path (e.g., tinker://run-id/sampler_weights/0001), the checkpoint loading fails with a "Path is invalid" error.

Root Cause

In ParsedCheckpointTinkerPath.from_tinker_path(), the checkpoint_id was including the type prefix (e.g., sampler_weights/0001), but the API expected different formats for training vs sampler checkpoints.

Fix

  1. Added a new api_checkpoint_id property to ParsedCheckpointTinkerPath:

    • For training: returns just the checkpoint number (0001)
    • For sampler: returns prefixed ID (sampler_weights/0001)
  2. Updated rest_client.py to use api_checkpoint_id instead of checkpoint_id

Testing

Added tests/test_sampler_weights_loading.py with tests for parsing both checkpoint types.

Good day,

Thank you for your work on this excellent library!

Warmly,
RoomWithOutRoof

- Add api_checkpoint_id property to ParsedCheckpointTinkerPath that returns:
  - For training checkpoints: just the checkpoint number (e.g., '0001')
  - For sampler checkpoints: the prefixed ID (e.g., 'sampler_weights/0001')
- Update rest_client.py to use api_checkpoint_id instead of checkpoint_id
- Add test_sampler_weights_loading.py with comprehensive tests

Fixes Issue thinking-machines-lab#25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant