Skip to content

Fix typo in classification function selection logic to improve code consistency#32031

Merged
amyeroberts merged 1 commit intohuggingface:mainfrom
flarehealth:issue-32030
Jul 17, 2024
Merged

Fix typo in classification function selection logic to improve code consistency#32031
amyeroberts merged 1 commit intohuggingface:mainfrom
flarehealth:issue-32030

Conversation

@moses
Copy link
Contributor

@moses moses commented Jul 17, 2024

Fixes #32030
(previously tagged #32013 )

The existing logic has a typo in it, where, for example, it selects a sigmoid classification function if the problem type is "multi_label_classification" or num_labels is 1. The num_labels condition overrides the problem_type condition, so in practice, I don't think this error will cause a bug, but it's confusing.

This fix corrects the problem type conditions.

Please review at your convenience @Narsil

The latter condition generally overrides the former, so this is more of a code reading issue. I'm not sure the bug would ever actually get triggered under normal use.
@leloykun
Copy link
Contributor

Hi! I think you should be tagging this? #32030

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

@amyeroberts amyeroberts merged commit 63be8e6 into huggingface:main Jul 17, 2024
@moses moses deleted the issue-32030 branch July 17, 2024 22:42
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.

Minor typo in ImageClassificationPipeline

3 participants