Closed raopx closed 1 month ago
Hey @raopx I'll take up this issue, i'll first test and verify in my local and soon create a PR if needed , Thanks
Thanks for opening this issue @raopx! @aroun-coumar, let us know how it goes and if you need help!
Sure @ylacombe , I just started and i'll let you know Thanks
Please checkout this PR 33551
System Info
transformers
version: 4.44.2Who can help?
@ylacombe @eustlb
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Analysis:
After investigating the issue, I found that the HubertForSequenceClassification class does not correctly handle the problem_type parameter in its forward method. Specifically, it always uses CrossEntropyLoss, regardless of whether the task is a classification or regression task.
Here is the relevant code from transformers/models/hubert/modeling_hubert.py:
https://github.com/huggingface/transformers/blob/8bd2b1e8c23234cd607ca8d63f53c1edfea27462/src/transformers/models/hubert/modeling_hubert.py#L1633C9-L1637C1
Expected behavior
In other model implementations like BertForSequenceClassification, the forward method correctly handles different problem_type settings: