Skip to content

Fix: fix paligemma generation#33202

Closed
hiyouga wants to merge 3 commits intohuggingface:mainfrom
hiyouga:patch-8
Closed

Fix: fix paligemma generation#33202
hiyouga wants to merge 3 commits intohuggingface:mainfrom
hiyouga:patch-8

Conversation

@hiyouga
Copy link
Copy Markdown
Contributor

@hiyouga hiyouga commented Aug 29, 2024

What does this PR do?

In the latest transformers, Llama and Gemma models introduce num_logits_to_keep, whereas the Llava and PaliGemma VLMs do not accept this argument. The program raises exceptions:

model_inputs.update(
{
"position_ids": position_ids,
"cache_position": cache_position,
"past_key_values": past_key_values,
"use_cache": use_cache,
"attention_mask": attention_mask,
"num_logits_to_keep": num_logits_to_keep,
}
)

TypeError: PaliGemmaForConditionalGeneration.forward() got an unexpected keyword argument 'num_logits_to_keep'

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@amyeroberts

@hiyouga
Copy link
Copy Markdown
Contributor Author

hiyouga commented Aug 29, 2024

Close because duplicate of #33168

@hiyouga hiyouga closed this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant