Skip to content

Add minimal reference model fetch and metadata caching - #2

Open
TylerZeroMaster wants to merge 10 commits into
dreamfast:masterfrom
TylerZeroMaster:master
Open

Add minimal reference model fetch and metadata caching#2
TylerZeroMaster wants to merge 10 commits into
dreamfast:masterfrom
TylerZeroMaster:master

Conversation

@TylerZeroMaster

Copy link
Copy Markdown

Summary

This PR adds a way to download only the minimum required model metadata (safetensors headers, configs, and tokenizers) to get tensor shapes, bypassing the need to download gigabytes of full model weights. It integrates seamlessly with existing conversion scripts.

Why this change?

I used this tool for my first LoRA adapter project because transformers did not want to open my GGUF. I did not want to download full model weights just to get tensor shapes. This adds a way to download the minimum metadata required and save it to the reference model directory.

Changes

  • Added fetch-reference CLI command: Fetches only safetensors header bytes (a few KB) plus config/tokenizer files, caching shapes in ungguf_model_meta.json.
  • Added load_model_metadata() in common.py: Converters now use cached metadata automatically, with an automatic rescan if local safetensors files are newer.
  • Added ignore-missing-mtp / ignore-missing-visual flags: Specifically for Qwen3.5: handle GGUFs that omit MTP/vision tensors. The Qwen3.5 verifier remains intact; these flags act as explicit opt-ins for incomplete outputs.
  • Documentation & Testing: Updated the README and added relevant tests.

The generated cache file also serves as a human-readable snapshot of tensor shapes/dtypes, which I found useful for debugging conversion issues.

Aside

I am still not sure why transformers did not want to open the Qwen3.5 model i downloaded. I suspect the model was converted with the --no-mtp option as it was missing MTP heads. Maybe that, or missing visual keys, is why transformers did not want to open it.

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