Skip to content

Conversation

@ishitab02
Copy link
Contributor

This PR resolves the AttributeError caused by BaseTokenizer.normalize() calling a non-existent method.
Fixes #1882

Before

The normalize method was calling self._tokenizer.normalize(sequence), which does not exist on the internal Tokenizer object. This was raising an AttributeError.

After

Changed to use self._tokenizer.normalizer.normalize_str(sequence) which is the correct public API for normalizing plain strings.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, we don't have any tests as this is not highly maintained :) LGTM

@ArthurZucker ArthurZucker merged commit bc6e6cd into huggingface:main Nov 28, 2025
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.

BaseTokenizer.normalize method calls non-existent _tokenizer.normalize

2 participants