Skip to content

[FIX] avoid proxying __call__ to inner tokenizer (ChatGLMTokenizer compatibility)#42

Merged
Qubitium merged 2 commits intomainfrom
zx_fix_chatglm
Feb 9, 2026
Merged

[FIX] avoid proxying __call__ to inner tokenizer (ChatGLMTokenizer compatibility)#42
Qubitium merged 2 commits intomainfrom
zx_fix_chatglm

Conversation

@ZX-ModelCloud
Copy link
Collaborator

Tokenicer overrides getattribute to proxy attribute access to the wrapped
HuggingFace tokenizer. However, this unintentionally forwards magic methods
(e.g. call) to the inner tokenizer instance.

This breaks ChatGLMTokenizer, whose internal tokenizer is an SPTokenizer.
SPTokenizer is NOT callable, so proxying call causes:

TypeError: 'SPTokenizer' object is not callable

…patibility)

Signed-off-by: ZX-ModelCloud <zx@modelcloud.ai>
Signed-off-by: ZX-ModelCloud <zx@modelcloud.ai>
@Qubitium Qubitium merged commit 9eb02b5 into main Feb 9, 2026
@Qubitium Qubitium deleted the zx_fix_chatglm branch February 9, 2026 06:36
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