Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise error if ClassLabel names is not python list #5359

Merged

Conversation

freddyheppell
Copy link
Contributor

Checks type of names provided to ClassLabel to avoid easy and hard to debug errors (closes #5332 - see for discussion)

@freddyheppell freddyheppell marked this pull request as ready for review December 13, 2022 23:04
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Dec 14, 2022

The documentation is not available anymore as the PR was closed or merged.

@albertvillanova
Copy link
Member

Thanks for your proposed fix, @freddyheppell.

Currently the CI fails because in a test we pass a tuple instead of a list. I would say we should accept tuple as a valid input type as well...

What about checking for Sequence instead?

@freddyheppell
Copy link
Contributor Author

Fixed that @albertvillanova, can you approve CI again please? Had some issues related to Pytorch .so files when running tests on my M1 mac, so wasn't able to test locally first. Have got them working on my desktop now though.

Copy link
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

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

CI is green. Thanks for the fix and the test!!

Copy link
Collaborator

@mariosasko mariosasko left a comment

Choose a reason for hiding this comment

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

Replaced ValueError with TypeError. Looks good now, thanks!

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.

Passing numpy array to ClassLabel names causes ValueError
5 participants