fix: allow single checkpoint path in delete command#29
Open
Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Open
fix: allow single checkpoint path in delete command#29Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Jah-yee wants to merge 1 commit intothinking-machines-lab:mainfrom
Conversation
Changed from nargs=-1 (variadic) to single argument to fix parsing issue where 'tinker checkpoint delete tinker://run-id/...' was incorrectly parsed as unexpected extra argument. The original variadic argument design conflicted with Click's option parsing, causing the checkpoint path to be misinterpreted as an extra argument. Fixes thinking-machines-lab#24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Good day,
This PR fixes issue #24 where passing a checkpoint path directly to
tinker checkpoint deleteresulted in "unexpected extra argument" error.Problem
Using
tinker checkpoint delete tinker://run-id/weights/0001throws:The issue was that
checkpoint_pathswas defined as a variadic argument (nargs=-1), which conflicted with Click's option parsing, causing the path to be misinterpreted as an extra argument.Solution
Changed from variadic argument to single optional argument:
@click.argument("checkpoint_paths", nargs=-1, required=False)@click.argument("checkpoint_path", required=False)This allows exactly one checkpoint path to be passed directly.
Testing
tinker checkpoint delete tinker://run-id/weights/0001now parses correctlyThank you for your work on Tinker!
Warmly, RoomWithOutRoof