Unverified Commit 467164ea authored by Raushan Turganbay's avatar Raushan Turganbay Committed by GitHub
Browse files

Llava: remove dummy labels (#30706)

remove labels from llavas
parent 1872bde7
...@@ -442,8 +442,6 @@ class LlavaForConditionalGeneration(LlavaPreTrainedModel): ...@@ -442,8 +442,6 @@ class LlavaForConditionalGeneration(LlavaPreTrainedModel):
inputs_embeds, attention_mask, labels, position_ids = self._merge_input_ids_with_image_features( inputs_embeds, attention_mask, labels, position_ids = self._merge_input_ids_with_image_features(
image_features, inputs_embeds, input_ids, attention_mask, labels 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 # In case input_ids.shape[1] == 1 & pixel_values==None & past_key_values != None, we are in the case of
# generation with cache # generation with cache
......
...@@ -436,8 +436,6 @@ class VipLlavaForConditionalGeneration(VipLlavaPreTrainedModel): ...@@ -436,8 +436,6 @@ class VipLlavaForConditionalGeneration(VipLlavaPreTrainedModel):
inputs_embeds, attention_mask, labels, position_ids = self._merge_input_ids_with_image_features( inputs_embeds, attention_mask, labels, position_ids = self._merge_input_ids_with_image_features(
image_features, inputs_embeds, input_ids, attention_mask, labels 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: else:
# In case input_ids.shape[1] == 1 & pixel_values==None & past_key_values != None, we are in the case of # In case input_ids.shape[1] == 1 & pixel_values==None & past_key_values != None, we are in the case of
# generation with cache # generation with cache
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment