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

separate kwargs in processor (similar to #30193) #30905

Merged
merged 2 commits into from
May 20, 2024

Conversation

Eric2i
Copy link
Contributor

@Eric2i Eric2i commented May 20, 2024

What does this PR do?

Similar to #30193, this PR separates out the kwargs that are passed to the git processor into tokenizer and image processor kwargs.

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?

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for adding this @Eric2i!

For context, is there a particular bug or specific issue this is being added to address?

cc @molbap for reference

@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.

@Eric2i
Copy link
Contributor Author

Eric2i commented May 20, 2024

More Context

When running the following piece of code:

processor = AutoProcessor.from_pretrained("microsoft/git-base")
encoding = processor(images=Image.open("Cat.jpg"), text="A cute cat.", padding="max_length")

I observed a similar warning message ("unused or unrecognized kwargs: padding") in issue#30106, which is nicely fixed by PR#30905.

So, I tried to fix the same problem for this processing_git.py file and now it works without the warning message.

Other Thought

This looks like a common problem in multiple processors. Probably similar updates are also needed for other ones.

Thanks!

@amyeroberts
Copy link
Collaborator

@Eric2i Great thanks for the details! There's actually a big PR which will be merged in soon which should address this (and many other difficulties with processor kwargs!) #30511

@amyeroberts amyeroberts merged commit 7b4b456 into huggingface:main May 20, 2024
19 checks passed
@Eric2i Eric2i deleted the seperate-git-processor branch May 20, 2024 17:22
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.

3 participants