transformers
bfd3604d - Fix left-padding token selection in `BioGptForSequenceClassification` (#46782)

Commit
20 hours ago
Fix left-padding token selection in `BioGptForSequenceClassification` (#46782) Fix left-padding token selection in BioGptForSequenceClassification BioGptForSequenceClassification was the last decoder classification head still using the legacy pooling index (input_ids != pad).sum(-1) - 1, which is the last real token only under right padding. With left padding the real tokens are shifted to the end, so the head pooled an earlier token and returned silently wrong logits and loss. Use the same left/right-padding safe selection as the other decoders (from #35911). Signed-off-by: Ting Sun <suntcrick@gmail.com>
Author
Parents
Loading