Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generate kwargs to VQA pipeline #29134

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

regisss
Copy link
Contributor

@regisss regisss commented Feb 20, 2024

What does this PR do?

As per title.

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?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@regisss regisss requested a review from gante February 20, 2024 09:43
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@@ -123,9 +123,9 @@ def preprocess(self, inputs, padding=False, truncation=False, timeout=None):
model_inputs.update(image_features)
return model_inputs

def _forward(self, model_inputs):
def _forward(self, model_inputs, **generate_kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Context for others: this is how we do it in other generative pipelines, e.g. here

Copy link
Member

@gante gante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding support for this 💛

@gante gante requested a review from ArthurZucker February 26, 2024 13:43
Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably small test to make sure all pipelines support these 👍🏻

@ArthurZucker ArthurZucker merged commit a3f9221 into huggingface:main Feb 27, 2024
8 checks passed
@regisss regisss deleted the vqa_pipeline_generate_kwargs branch February 27, 2024 02:03
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.

4 participants