Skip to content

Conversation

@ZachNagengast
Copy link
Collaborator

For whatever reason, certain config files for unigram tokenizers end up reading scores as NSNumber instead of float, and throw malformedVocab errors.

Expected a Float but found __NSCFNumber

This doesn't convert directly to Float, so I'm adding one fallback here to attempt to convert it to float before throwing.

@ZachNagengast ZachNagengast requested a review from pcuenca April 28, 2024 18:31
@pcuenca
Copy link
Member

pcuenca commented Apr 28, 2024

Interesting! Maybe because of precision issues?

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

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

Looks good to me, I'll run the tests locally.

@pcuenca pcuenca merged commit fc65432 into huggingface:main Apr 28, 2024
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