Fix TypeError in rope validation when ignore_keys is a list#45069
Merged
Rocketknight1 merged 1 commit intohuggingface:mainfrom Mar 30, 2026
Merged
Fix TypeError in rope validation when ignore_keys is a list#45069Rocketknight1 merged 1 commit intohuggingface:mainfrom
Rocketknight1 merged 1 commit intohuggingface:mainfrom
Conversation
`_check_received_keys` performs `received_keys -= ignore_keys` where
`received_keys` is a `set`. When model configs are loaded from JSON
(e.g. via huggingface_hub dataclass validation), sets get deserialized
as lists since JSON has no set type, causing:
TypeError: unsupported operand type(s) for -=: 'set' and 'list'
Wrapping with `set()` handles both cases (no-op for sets, converts lists).
Fixes huggingface#45068
Rocketknight1
approved these changes
Mar 30, 2026
Member
Rocketknight1
left a comment
There was a problem hiding this comment.
Makes sense to me, and should be safe!
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
NielsRogge
pushed a commit
to NielsRogge/transformers
that referenced
this pull request
Mar 30, 2026
…ace#45069) `_check_received_keys` performs `received_keys -= ignore_keys` where `received_keys` is a `set`. When model configs are loaded from JSON (e.g. via huggingface_hub dataclass validation), sets get deserialized as lists since JSON has no set type, causing: TypeError: unsupported operand type(s) for -=: 'set' and 'list' Wrapping with `set()` handles both cases (no-op for sets, converts lists). Fixes huggingface#45068 Co-authored-by: IrinaArmstrong <a.irene.a@mail.ru>
SangbumChoi
pushed a commit
to SangbumChoi/transformers
that referenced
this pull request
Apr 4, 2026
…ace#45069) `_check_received_keys` performs `received_keys -= ignore_keys` where `received_keys` is a `set`. When model configs are loaded from JSON (e.g. via huggingface_hub dataclass validation), sets get deserialized as lists since JSON has no set type, causing: TypeError: unsupported operand type(s) for -=: 'set' and 'list' Wrapping with `set()` handles both cases (no-op for sets, converts lists). Fixes huggingface#45068 Co-authored-by: IrinaArmstrong <a.irene.a@mail.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a
TypeErrorin_check_received_keys(line 919 ofmodeling_rope_utils.py) wherereceived_keys -= ignore_keysfails whenignore_keysis alistinstead of aset.Root cause
Model configs (Qwen3.5, ErnieVLMoe, GLM4V, Ministral3) define
ignore_keys_at_rope_validationas a Pythonset. JSON has no set type, so when configs are serialized/deserialized (e.g. viahuggingface_hubstrict dataclass validation), sets become lists. The-=operator onsetdoesn't acceptlistoperands.Fix
set()is a no-op for set inputs and correctly converts lists.Error
Triggered by vLLM 0.18.0 serving
Qwen/Qwen3.5-35B-A3B.Fixes #45068