Llava: remove dummy labels (#30706)

remove labels from llavas
This commit is contained in:
Raushan Turganbay 2024-05-08 18:35:49 +05:00 committed by GitHub
parent 1872bde7fc
commit 467164ea0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 4 deletions

View File

@ -442,8 +442,6 @@ class LlavaForConditionalGeneration(LlavaPreTrainedModel):
inputs_embeds, attention_mask, labels, position_ids = self._merge_input_ids_with_image_features(
image_features, inputs_embeds, input_ids, attention_mask, labels
)
if labels is None:
labels = torch.full_like(attention_mask, self.config.ignore_index).to(torch.long)
# In case input_ids.shape[1] == 1 & pixel_values==None & past_key_values != None, we are in the case of
# generation with cache

View File

@ -436,8 +436,6 @@ class VipLlavaForConditionalGeneration(VipLlavaPreTrainedModel):
inputs_embeds, attention_mask, labels, position_ids = self._merge_input_ids_with_image_features(
image_features, inputs_embeds, input_ids, attention_mask, labels
)
if labels is None:
labels = torch.full_like(attention_mask, self.config.ignore_index).to(torch.long)
else:
# In case input_ids.shape[1] == 1 & pixel_values==None & past_key_values != None, we are in the case of
# generation with cache