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

[Fuyu] Add tests #27001

Merged
merged 15 commits into from
Nov 15, 2023
Merged

[Fuyu] Add tests #27001

merged 15 commits into from
Nov 15, 2023

Conversation

NielsRogge
Copy link
Contributor

@NielsRogge NielsRogge commented Oct 23, 2023

What does this PR do?

Fuyu currently is not being tested. This PR makes sure the model is tested.

To do:

  • the model should ideally work out-of-the-box with the image-to-text and vqa pipelines, so processor + image processor should be battle tested to make sure they fit the API. => can be addressed in a separate PR

For the latter, the following should ideally work without any additional code:

from transformers import FuyuProcessor, FuyuForCausalLM

processor = FuyuProcessor.from_pretrained("adept/fuyu-8b")
model = FuyuForCausalLM.from_pretrained("adept/fuyu-8b")

inputs = processor(images=image, text=text, return_tensors="pt")

outputs = model.generate(**inputs)
predictions = processor.batch_decode(outputs[0], skip_special_tokens=True)

cc @molbap

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Oct 23, 2023

The documentation is not available anymore as the PR was closed or merged.

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!

Improvements on the modeling file are great. For the tests, lets coordinate with @molbap to figure the best sequence of merges as there's a few pending PRs relating to Fuyu that are due to be merged e.g. #27133 #27007 #27083 and might affect this PR

src/transformers/models/fuyu/modeling_fuyu.py Outdated Show resolved Hide resolved
tests/models/fuyu/test_modeling_fuyu.py Show resolved Hide resolved
tests/models/fuyu/test_modeling_fuyu.py Outdated Show resolved Hide resolved
@ydshieh
Copy link
Collaborator

ydshieh commented Nov 10, 2023

Thanks for adding this!

Improvements on the modeling file are great. For the tests, lets coordinate with @molbap to figure the best sequence of merges as there's a few pending PRs relating to Fuyu that are due to be merged e.g. #27133 #27007 #27083 and might affect this PR

@NielsRogge, I think once you remove the extra file src/transformers/models/fuyu/test.py, and when CI green, we can request a final review.

@ydshieh
Copy link
Collaborator

ydshieh commented Nov 13, 2023

We have to put src/transformers/models/fuyu/modeling_fuyu.py in utils/slow_documentation_tests.txt to avoid timeout on CircleCI

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 and iterating on this!

In the PR description it's mentioned having the model be compatible with the VQA pipeline. Could you make sure the model is tested for the capability or update the description? Otherwise looks good!

tests/models/fuyu/test_modeling_fuyu.py Show resolved Hide resolved
tests/models/fuyu/test_modeling_fuyu.py Outdated Show resolved Hide resolved
tests/models/fuyu/test_modeling_fuyu.py Show resolved Hide resolved
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!

@ydshieh ydshieh merged commit cc0dc24 into huggingface:main Nov 15, 2023
18 checks passed
Saibo-creator pushed a commit to epfl-dlab/transformers-GCD-PR that referenced this pull request Nov 15, 2023
* Add tests

* Add integration test

* More improvements

* Fix tests

* Fix style

* Skip gradient checkpointing tests

* Update script

* Remove scripts

* Remove Fuyu from auto mapping

* Fix integration test

* More improvements

* Remove file

* Add Fuyu to slow documentation tests

* Address comments

* Clarify comment
wgifford pushed a commit to namctin/transformers that referenced this pull request Nov 17, 2023
* Add tests

* Add integration test

* More improvements

* Fix tests

* Fix style

* Skip gradient checkpointing tests

* Update script

* Remove scripts

* Remove Fuyu from auto mapping

* Fix integration test

* More improvements

* Remove file

* Add Fuyu to slow documentation tests

* Address comments

* Clarify comment
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
* Add tests

* Add integration test

* More improvements

* Fix tests

* Fix style

* Skip gradient checkpointing tests

* Update script

* Remove scripts

* Remove Fuyu from auto mapping

* Fix integration test

* More improvements

* Remove file

* Add Fuyu to slow documentation tests

* Address comments

* Clarify comment
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.

5 participants