Finetuned from model : oldhag88/qwen3.5-9b-nsfw-captioning-v5
This qwen3_5 model was trained 2x faster with Unsloth and Huggingface's TRL library.
this model needs a patch. for some reason, it may not work with lm studio due to some weird tensor thing. I will patch it when I have time
"""
patch_gguf_qwen36.py
Fixes the Qwen3.5/3.6 GGUF "missing tensor 'blk.N.attn_norm.weight'" load error.
The exporter declares an extra MTP (multi-token prediction) block in GGUF
metadata but doesn't write its tensors, so llama.cpp / LM Studio refuse to
load the file. This patch updates the metadata to match what's actually
written: block_count = real layer count, nextn_predict_layers = 0.
For Qwen3.6-27B the real text layer count is 64.
For Qwen3.5-9B (the previous workflow) it was 32.
If the script prints unexpected values when patching, run the
override-kv test (see the skill) to find the right number, then edit
EXPECTED_BLOCK_COUNT below before re-patching.
Usage:
python patch_gguf_qwen36.py
"""
import struct
from pathlib import Path
------ EDIT THESE IF NEEDED ------------------------------------------------