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

Support arbitrary processor #30875

Merged
merged 14 commits into from
May 17, 2024
Merged

Support arbitrary processor #30875

merged 14 commits into from
May 17, 2024

Conversation

ArthurZucker
Copy link
Collaborator

@ArthurZucker ArthurZucker commented May 17, 2024

What does this PR do?

Saves the tokenizer class, making sure that the defaults that are stored in transformers are not blocking people from re-using pre-processors. Superseed #30030

For previous models:

import requests
from PIL import Image
from transformers import LlavaProcessor, LlavaForConditionalGeneration

checkpoint = "Intel/llava-gemma-2b"
processor = LlavaProcessor.from_pretrained(checkpoint, tokenizer_class="GemmaTokenizerFast")

But once saved, the tokenizer_class will be part of the processor_config.json, no need to specify it further.

Before merging:

  • Add tests
  • Add doc

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

@ArthurZucker ArthurZucker marked this pull request as ready for review May 17, 2024 11:44
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.

Nice - thanks for enabling this!

@ArthurZucker ArthurZucker merged commit 0a9300f into main May 17, 2024
21 checks passed
@ArthurZucker ArthurZucker deleted the arbitrary-processor branch May 17, 2024 14:51
itazap pushed a commit that referenced this pull request May 24, 2024
* Support arbitrary processor

* fix

* nit

* update

* nit

* nit

* fix and revert

* add a small test

* better check

* fixup

* bug so let's just use class for now

* oups

* .
@muhark
Copy link

muhark commented May 31, 2024

Thank you for adding this and I am so sorry for not following up!

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.

None yet

4 participants