Florence2LanguageForConditionalGeneration has no shift_tokens_right method defined in the class
Browse filesCall `prepare_decoder_input_ids_from_labels` instead of `shift_tokens_right` as it is not defined in `Florence2LanguageForConditionalGeneration`
- modeling_florence2.py +1 -1
modeling_florence2.py
CHANGED
@@ -2841,7 +2841,7 @@ class Florence2ForConditionalGeneration(Florence2PreTrainedModel):
|
|
2841 |
}
|
2842 |
|
2843 |
def prepare_decoder_input_ids_from_labels(self, labels: torch.Tensor):
|
2844 |
-
return self.language_model.
|
2845 |
|
2846 |
def _reorder_cache(self, *args, **kwargs):
|
2847 |
return self.language_model._reorder_cache(*args, **kwargs)
|
|
|
2841 |
}
|
2842 |
|
2843 |
def prepare_decoder_input_ids_from_labels(self, labels: torch.Tensor):
|
2844 |
+
return self.language_model.prepare_decoder_input_ids_from_labels(labels)
|
2845 |
|
2846 |
def _reorder_cache(self, *args, **kwargs):
|
2847 |
return self.language_model._reorder_cache(*args, **kwargs)
|