Skip to content

Feature Request : Add support for 'qwen2' text model architecture #397

@tinydream96

Description

@tinydream96

Hi! Thanks for the great work on this node.

I am trying to use Qwen2.5-7B (e.g., qwen2.5-7b-instruct-q4_k_m.gguf) as a CLIP/Text Encoder for the TwinFlow model. However, loading this GGUF fails because the architecture string in the file is 'qwen2', which is currently not in the allowlist.

Error Message:
ValueError: Unexpected text model architecture type in GGUF file: 'qwen2'

Proposed Fix: I manually modified loader.py locally and it works perfectly. Here are the changes needed:
Add "qwen2" to TXT_ARCH_LIST:

TXT_ARCH_LIST = {"t5", "t5encoder", "llama", "qwen2vl", "qwen3", "qwen3vl", "qwen2"}
Add "qwen2" to the check in gguf_clip_loader:

elif arch in {"llama", "qwen2vl", "qwen3", "qwen3vl", "qwen2"}:
Enable llama permutation for "qwen2" (since it shares the architecture):

if arch == "llama" or arch == "qwen2":
sd = llama_permute(sd, 32, 8)

Could you please add official support for this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions