Skip to content

Fix: qwen3_5 model type not recognized by Transformers#2

Closed
www917 wants to merge 1 commit intomasterfrom
cursor/qwen3-5-model-recognition-7081
Closed

Fix: qwen3_5 model type not recognized by Transformers#2
www917 wants to merge 1 commit intomasterfrom
cursor/qwen3-5-model-recognition-7081

Conversation

@www917
Copy link
Copy Markdown
Owner

@www917 www917 commented Mar 25, 2026

Problem

When loading a Qwen3.5 model checkpoint (e.g. Qwen/Qwen3.5-4B) with vLLM or transformers, the following error occurs:

KeyError: 'qwen3_5'

ValueError: The checkpoint you are trying to load has model type `qwen3_5`
but Transformers does not recognize this architecture.

Root Cause

The qwen3_5 model type was added to the Hugging Face transformers library in version 5.2.0 (released February 16, 2026, via PR #43830). Older versions lack the CONFIG_MAPPING entry for qwen3_5 in configuration_auto.py, which causes the KeyError.

Solution

Upgrade transformers to version >= 5.2.0:

pip install "transformers>=5.2.0"

Or install from source if no release supports it yet:

pip install git+https://github.com/huggingface/transformers.git

Changes

  • requirements.txt: Added transformers>=5.2.0 as a minimum version requirement
  • fix_qwen3_5_model_recognition.sh: Automated fix script that upgrades transformers and verifies the fix
  • QWEN3_5_FIX.md: Documentation of the issue, root cause, and solutions

References

Open in Web Open in Cursor 

The qwen3_5 model type was added in transformers v5.2.0 (Feb 2026).
Older versions lack the CONFIG_MAPPING entry for qwen3_5, causing:
  KeyError: 'qwen3_5'
  ValueError: ...does not recognize this architecture

Added:
- requirements.txt: minimum transformers>=5.2.0
- fix_qwen3_5_model_recognition.sh: automated fix script
- QWEN3_5_FIX.md: documentation of the issue and solution

Co-authored-by: www917 <www917@users.noreply.github.com>
@www917 www917 closed this Mar 25, 2026
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.

2 participants