Skip to content

[Fuyu] Add tests#27001

Merged
ydshieh merged 15 commits into
huggingface:mainfrom
NielsRogge:add_fuyu
Nov 15, 2023
Merged

[Fuyu] Add tests#27001
ydshieh merged 15 commits into
huggingface:mainfrom
NielsRogge:add_fuyu

Conversation

@NielsRogge

@NielsRogge NielsRogge commented Oct 23, 2023

Copy link
Copy Markdown
Collaborator

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

HuggingFaceDocBuilderDev commented Oct 23, 2023

Copy link
Copy Markdown

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

@amyeroberts amyeroberts left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread src/transformers/models/fuyu/modeling_fuyu.py Outdated
Comment thread tests/models/fuyu/test_modeling_fuyu.py Outdated
Comment thread tests/models/fuyu/test_modeling_fuyu.py Outdated
Comment thread src/transformers/models/fuyu/test.py Outdated
@ydshieh

ydshieh commented Nov 10, 2023

Copy link
Copy Markdown
Collaborator

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

ydshieh commented Nov 13, 2023

Copy link
Copy Markdown
Collaborator

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

@amyeroberts amyeroberts left a comment

Copy link
Copy Markdown
Contributor

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!

Comment thread tests/models/fuyu/test_modeling_fuyu.py
Comment thread tests/models/fuyu/test_modeling_fuyu.py Outdated
Comment thread tests/models/fuyu/test_modeling_fuyu.py Outdated

@amyeroberts amyeroberts left a comment

Copy link
Copy Markdown
Contributor

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