Skip to content

fix: use api_checkpoint_id for sampler_weights loading#35

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

fix: use api_checkpoint_id for sampler_weights loading#35
Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Jah-yee:fix-sampler-weights

Conversation

@Jah-yee
Copy link
Copy Markdown

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

Good day,

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

Summary

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 for parsing both checkpoint types.

Thank you for your work on this excellent library!

Warmly,
RoomWithOutRoof

- Added api_checkpoint_id property to ParsedCheckpointTinkerPath
- For training checkpoints: returns just the checkpoint number (e.g., '0001')
- For sampler checkpoints: returns prefixed ID (e.g., 'sampler_weights/0001')
- Updated rest_client.py to use api_checkpoint_id instead of checkpoint_id
@Jah-yee
Copy link
Copy Markdown
Author

Jah-yee commented Apr 15, 2026

Good day 👋

Just a gentle bump on this PR! This fix adds support for using api_checkpoint_id when loading sampler_weights, which should improve the checkpoint loading flow.

Would love to get your thoughts or review when you have a moment!

Thank you for your work and happy coding! 🚀

Warmly,
RoomWithOutRoof

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