I have encountered an issue with the current implementation where final_labels is hardcoded to None, which prevents the loss calculation even when labels is provided and not None.
Proposed Fix: Assign labels to final_labels. This way, final_labels can be None or have some value based on labels.
I have created a working fork demonstrating this fix, and it successfully generates loss:
Fork: https://github.com/ariG23498/transformers/tree/aritra/ft-paligemma
Colab Notebook: https://colab.research.google.com/drive/1W27YMyyQG2ynUo6BYvru2xkzCS8ff83m?usp=sharing
I have encountered an issue with the current implementation where
final_labelsis hardcoded toNone, which prevents the loss calculation even whenlabelsis provided and notNone.transformers/src/transformers/models/paligemma/modeling_paligemma.py
Line 349 in 87a3518
Proposed Fix: Assign
labelstofinal_labels. This way,final_labelscan beNoneor have some value based onlabels.I have created a working fork demonstrating this fix, and it successfully generates loss:
Fork: https://github.com/ariG23498/transformers/tree/aritra/ft-paligemma
Colab Notebook: https://colab.research.google.com/drive/1W27YMyyQG2ynUo6BYvru2xkzCS8ff83m?usp=sharing