[fix] fix issue with BloomBlock due to transformers upgrade #2640
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
While working on #2639, I noticed an issue with upgrading the transformers version for unit tests:
I tried a few things to fix this, but ended up opting for the suggestion from transformers here https://huggingface.co/docs/transformers/en/kv_cache#legacy-cache-format. The rest of the code relies on the legacy cache format, so I convert to/from within this to keep the rest of the code as is.
After this change, I ran the full test suite with results:
Type of change
Please delete options that are not relevant.
Checklist:
pytest tests.py -k "TestCorrectnessLmiDist" -m "lmi_dist"
Feature/Issue validation/testing
Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.
In addition to fixing the issue mentioned previously, I validated that the outputs from this test match those from before this change, which gives confidence since we're using a real model in this test:
Before Change
After Change: