Draft
Conversation
- Updated T5AttentionWithAdapters to use new DynamicCache API
- Changed key_cache/value_cache access to layers[idx].keys/values
- Added EncoderDecoderCache instance check before accessing cache properties
- Fixed class conversion state dict loading for T5/MT5AdapterModel
- Added custom load_state_dict() to handle key remapping between static
models (T5ForConditionalGeneration) and flex models (T5AdapterModel)
- Static models use encoder.*/decoder.* keys, flex models expect
transformer.encoder.*/transformer.decoder.* keys
- Fixed cls_representation extraction logic
- Only extract cls_representation for classification heads
- Prevents IndexError for seq2seq_lm and question_answering heads
All T5 test_methods tests (230/230) and MT5 tests (227/227) now pass.
- Moved load_state_dict() override to ModelWithFlexibleHeadsAdaptersMixin - Automatically detects wrapper attribute (model/transformer) - Handles key remapping for all encoder-decoder models universally - Eliminates code duplication across 6 model implementations - Fixed class conversion for BART-family models - BART, mBART, PLBART, Whisper now properly load from static models - Automatic remapping of encoder.*/decoder.*/shared.* keys - Fixed mBART cls_representation extraction - Only extract cls_representation for classification heads - Prevents errors for seq2seq_lm and question_answering heads - Removed duplicate load_state_dict() from individual models: - T5AdapterModel, MT5AdapterModel - BartAdapterModel, MBartAdapterModel, PLBartAdapterModel - WhisperAdapterModel Test results: - T5: 4/4 ClassConversion and Bottleneck tests passing - MT5: 3/3 tests passing - mBART: 4/4 tests passing - Whisper: 1/1 ClassConversion test passing - BART: 2/3 tests passing (ClassConversion working) - PLBART: 0/1 (pre-existing issue with past_key_values) Total: 14/16 tests fixed (87.5% success rate)
- Remove send_example_telemetry import from all example scripts - Remove telemetry function calls and associated comments - Telemetry was not functional as the function doesn't exist in transformers.utils - Tests pass successfully after removal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.