Skip to content

Commit

Permalink
Merge pull request haotian-liu#640 from dribnet/allow_inputs_embeds
Browse files Browse the repository at this point in the history
allow inputs_embeds to be passed to forward call
  • Loading branch information
haotian-liu authored Nov 4, 2023
2 parents 82d5788 + 671c815 commit 5978c26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llava/model/language_model/llava_llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def forward(
)
return_dict = return_dict if return_dict is not None else self.config.use_return_dict

input_ids, attention_mask, past_key_values, inputs_embeds, labels = self.prepare_inputs_labels_for_multimodal(input_ids, attention_mask, past_key_values, labels, images)
input_ids, attention_mask, past_key_values, inputs_embeds_prepared, labels = self.prepare_inputs_labels_for_multimodal(input_ids, attention_mask, past_key_values, labels, images)
if inputs_embeds is None:
inputs_embeds = inputs_embeds_prepared

# decoder outputs consists of (dec_features, layer_state, dec_hidden, dec_attn)
outputs = self.model(
Expand Down

0 comments on commit 5978c26

Please sign in to comment.