Skip to content

fix: pass rope_scaling=None for Qwen3 to avoid unhashable dict error#198

Open
CruxZhou wants to merge 1 commit into
GeeeekExplorer:mainfrom
CruxZhou:rope-fix
Open

fix: pass rope_scaling=None for Qwen3 to avoid unhashable dict error#198
CruxZhou wants to merge 1 commit into
GeeeekExplorer:mainfrom
CruxZhou:rope-fix

Conversation

@CruxZhou

@CruxZhou CruxZhou commented Apr 9, 2026

Copy link
Copy Markdown

Summary

This PR fixes a runtime error when loading Qwen3 models with newer versions of transformers(>5).

Problem

Qwen3Attention forwards config.rope_scaling into get_rope(...), but get_rope() does not currently implement RoPE scaling and assumes rope_scaling is None.

In newer transformers versions, config.rope_scaling may be parsed as a dict, which causes:

TypeError: unhashable type: 'dict'

because get_rope() is cached with lru_cache.

Fix

Pass rope_scaling=None explicitly in Qwen3Attention.

This keeps behavior aligned with the current implementation status and avoids the runtime error without changing existing RoPE logic.

Fixes #189

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.

Qwen models initialization fails with TypeError: unhashable type: 'dict' and AssertionError due to rope_scaling

1 participant