Repository navigation
Conversation
KarrAcaRn
pushed a commit
to KarrAcaRn/FreeToken-ByAI
that referenced
this pull request
Oct 3, 2026
…ting Alternative to upstream PR FlashML-org#589: resolving at the CLI with download_hf_weight only fetches weight shards, so a fresh HF cache still lacks tokenizer and remote-code files. Resolve in convert_checkpoint and pull the metadata too. Assisted-by: Claude Opus 5.5
KarrAcaRn
pushed a commit
to KarrAcaRn/FreeToken-ByAI
that referenced
this pull request
Oct 3, 2026
Adds the fork's PR triage tooling (fork/pr_queue.py) and logs FlashML-org#591, FlashML-org#590, FlashML-org#589, FlashML-org#587 and FlashML-org#585. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
KarrAcaRn
pushed a commit
to KarrAcaRn/FreeToken-ByAI
that referenced
this pull request
Oct 3, 2026
…ting Alternative to upstream PR FlashML-org#589: resolving at the CLI with download_hf_weight only fetches weight shards, so a fresh HF cache still lacks tokenizer and remote-code files. Resolve in convert_checkpoint and pull the metadata too. Assisted-by: Claude Opus 5.5 Co-authored-by: rb <986796+rbrisita@users.noreply.github.com>
KarrAcaRn
pushed a commit
to KarrAcaRn/FreeToken-ByAI
that referenced
this pull request
Oct 3, 2026
Adds the fork's PR triage tooling (fork/pr_queue.py) and logs FlashML-org#591, FlashML-org#590, FlashML-org#589, FlashML-org#587 and FlashML-org#585. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
Summary
ft checkpoint --model <hf-repo-id>produced an FTW checkpoint that wasmissing its metadata (
config.json,tokenizer.json,tokenizer_config.json, etc), so the output was not self-contained and couldnot be loaded with
--model <ftw_dir>.Root cause
convert_checkpointassumesmodel_pathis a filesystem path. It walksit with
os.walkand checks it withos.path.isfile/os.path.isdir, andglobs it for shards:
python/freetoken/checkpoint/convert.py→_copy_metadata(
os.path.isfile(model_path),os.walk(model_path))_source_fingerprint(glob.glob(os.path.join(model_path, "*.safetensors")))All of these treat their argument as a local path. A Hugging Face repo
Id such as
nvidia/Gemma-4-26B-A4B-NVFP4is a Hub identifier, not afilesystem path. So
os.walkwas looking for a directory namednvidia/containingGemma-4-26B-A4B-NVFP4relative to CWD.The dangerous part is that this fails silently:
os.walkon anon-existent path yields nothing instead of raising.
_copy_metadatareturned an empty list,
copied_metadatawas recorded as[], and theconversion "succeeded" with only the
.ftwshards written.Reproduction
ft checkpoint --model nvidia/Gemma-4-26B-A4B-NVFP4 --out ./gemma-ftw ls ./gemma-ftw # only the .ftw shards + index; no config.json / tokenizer*.json, etcFix
Resolve the model path once, at the CLI boundary, before handing it to
convert_checkpoint:
download_hf_weightalready handles the local-vs-repo distinctionelsewhere in FreeToken: a path that exists on disk is used as-is, and a
repo Id is fetched via
snapshot_downloadand returned as a localdirectory.
convert_checkpointthen sees a real path in both cases andneeds no changes of its own.
Testing
Specs
ft checkpoint --model nvidia/Gemma-4-26B-A4B-NVFP4 --out ./outOutput now contains config.json, tokenizer.json,
tokenizer_config.json, etc, and
index["copied_metadata"] is non-empty.
ft checkpoint --model /local/hf-dir --out ./outUnchanged; local paths still pass through untouched.
ft checkpoint --model /local/ftw-dir --out ./outUnchanged; responds with "<model> is already an FTW checkpoint".
ft serve --model ./outloads the FTW via the fast path withoutreferencing the original HF directory.
Issue
FIxes issue #147