transformers/tests/generation
Yoni Gozlan a245011252
Add InternVL (2.5 MPO) (#35968)
* initial commit

* add convert internvl

* add first end-to-end working internvl

* nit prompt and image proc

* add working chat template

* add conversion llama-based models

* add tests

* pass all tests

* fix isort

* fix modular after main merge

* add video processing for internvl

* add support for interlaced images and videos

* Remove processing and config from modular, add more tests

* add llama model tests

* Modify processor for compatibility with refactored got ocr image processor

* add comments in processor

* Add docs and nits

* change video processing to use custom sample_indices_fn

* rebase and fix tests

* add processor tests

* Add changes Raushan review

* Use the new attention interface for the vision model

* nits

* add support for custom video_load_backend

* remove mention to InternVLTokenizer

* refactor vision model to simplify logic

* refactor processor for better readibility

* fix copies

* fix require av processor test

* refactor internVL vision

* Update processor and fix processing tests

* fix docstring

* update convert_weights for internvl3

* change image processor to fast by default

* remove do_center_crop=True in convert_weights

* force use_cache to True

* push_to_hub before reloading

* fix internVLVision for larger models

* update convert weight for qk norm

* fix convert_weights

* fix eos_token_id in convert

* update docs and integration tests

* make modifs after review

* fix wrong k_norm and reduce modular

* change image_token_index to image_token_id

* change checkpoint to OpenGVLab org

* last nits

* explicitely del self.num_key_value_groups

* add extra special tokens
2025-04-18 18:57:33 +02:00
..
__init__.py [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
test_beam_constraints.py Use Python 3.9 syntax in tests (#37343) 2025-04-08 14:12:08 +02:00
test_beam_search.py Use Python 3.9 syntax in tests (#37343) 2025-04-08 14:12:08 +02:00
test_candidate_generator.py prune LM Head for USD (#36695) 2025-04-08 16:44:10 +01:00
test_configuration_utils.py Use Python 3.9 syntax in tests (#37343) 2025-04-08 14:12:08 +02:00
test_fsdp.py [MLU] Fix FA2 check error, remove deepspeed-mlu deps. (#36159) 2025-03-31 11:02:49 +02:00
test_logits_process.py Use Python 3.9 syntax in tests (#37343) 2025-04-08 14:12:08 +02:00
test_stopping_criteria.py Use Python 3.9 syntax in tests (#37343) 2025-04-08 14:12:08 +02:00
test_streamers.py Use Python 3.9 syntax in tests (#37343) 2025-04-08 14:12:08 +02:00
test_utils.py Add InternVL (2.5 MPO) (#35968) 2025-04-18 18:57:33 +02:00