-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[BLIP-2] Improve conversion script #24854
Conversation
The documentation is not available anymore as the PR was closed or merged. |
1ae55de
to
14f9f2f
Compare
0c06392
to
f0d6e3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work updating this! In particular getting the comparison with the original model. It makes the script a lot cleaner.
Two main comments:
- Does this mean that the currently converted checkpoints on the hub need to be updated?
- The doc tests for the model should be added to documentation_tests.txt
src/transformers/models/blip_2/convert_blip_2_original_to_pytorch.py
Outdated
Show resolved
Hide resolved
src/transformers/models/blip_2/convert_blip_2_original_to_pytorch.py
Outdated
Show resolved
Hide resolved
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing and iterating!
src/transformers/models/blip_2/convert_blip_2_original_to_pytorch.py
Outdated
Show resolved
Hide resolved
src/transformers/models/blip_2/convert_blip_2_original_to_pytorch.py
Outdated
Show resolved
Hide resolved
Feel free to merge :) |
* Improve conversion script * Add int8 code example * Update tip * Fix code * Fix code snippet * Add nucleus sampling * More improvements * Address comments * Address comments
What does this PR do?
When investigating an issue reported here, I've reran and improved BLIP-2's conversion script (based on InstructBLIP).
It's important to compare apples-to-apples, so I had to fork the LAVIS repo and make sure the original model is also run in float32.