Arthur
19d58d31f1
Add MLLama (#33703)
* current changes
* nit
* Add cross_attenttion_mask to processor
* multi-image fixed
* Add cross_attenttion_mask to processor
* cross attn works in all cases
* WIP refactoring function for image processor
* WIP refactoring image processor functions
* Refactor preprocess to use global loops instead of list nested list comps
* Docstrings
* Add channels unification
* fix dtype issues
* Update docsrings and format
* Consistent max_image_tiles
* current script
* updates
* Add convert to rgb
* Add image processor tests
* updates!
* update
* god damn it I am dumb sometimes
* Precompute aspect ratios
* now this works, full match
* fix 😉
* nits
* style
* fix model and conversion
* nit
* nit
* kinda works
* hack for sdpa non-contiguous bias
* nits here and there
* latest c hanges
* merge?
* run forward
* Add aspect_ratio_mask
* vision attention mask
* update script and config variable names
* nit
* nits
* be able to load
* style
* nits
* there
* nits
* make forward run
* small update
* enable generation multi-turn
* nit
* nit
* Clean up a bit for errors and typos
* A bit more constant fixes
* 90B keys and shapes match
* Fix for 11B model
* Fixup, remove debug part
* Docs
* Make max_aspect_ratio_id to be minimal
* Update image processing code to match new implementation
* Adjust conversion for final checkpoint state
* Change dim in repeat_interleave (accordig to meta code)
* tmp fix for num_tiles
* Fix for conversion (gate<->up, q/k_proj rope permute)
* nits
* codestyle
* Vision encoder fixes
* pass cross attn mask further
* Refactor aspect ratio mask
* Disable text-only generation
* Fix cross attention layers order, remove q/k norm rotation for cross atention layers
* Refactor gated position embeddings
* fix bugs but needs test with new weights
* rope scaling should be llama3
* Fix rope scaling name
* Remove debug for linear layer
* fix copies
* Make mask prepare private func
* Remove linear patch embed
* Make precomputed embeddings as nn.Embedding module
* MllamaPrecomputedAspectRatioEmbedding with config init
* Remove unused self.output_dim
* nit, intermediate layers
* Rename ln and pos_embed
* vision_chunk_size -> image_size
* return_intermediate -> intermediate_layers_indices
* vision_input_dim -> hidden_size
* Fix copied from statements
* fix most tests
* Fix more copied from
* layer_id->layer_idx
* Comment
* Fix tests for processor
* Copied from for _prepare_4d_causal_attention_mask_with_cache_position
* Style fix
* Add MllamaForCausalLM
* WIP fixing tests
* Remove duplicated layers
* Remove dummy file
* Fix style
* Fix consistency
* Fix some TODOs
* fix language_model instantiation, add docstring
* Move docstring, remove todos for precomputed embeds (we cannot init them properly)
* Add initial docstrings
* Fix
* fix some tests
* lets skip these
* nits, remove print, style
* Add one more copied from
* Improve test message
* Make validate func private
* Fix dummy objects
* Refactor `data_format` a bit + add comment
* typos/nits
Co-authored-by: Pablo Montalvo <39954772+molbap@users.noreply.github.com>
* fix dummy objects and imports
* Add chat template config json
* remove num_kv_heads from vision attention
* fix
* move some commits and add more tests
* fix test
* Remove `update_key_name` from modeling utils
* remove num-kv-heads again
* some prelimiary docs
* Update chat template + tests
* nit, conversion script max_num_tiles from params
* Fix warning for text-only generation
* Update conversion script for instruct models
* Update chat template in converstion + test
* add tests for CausalLM model
* model_max_length, avoid null chat_template
* Refactor conversion script
* Fix forward
* Fix integration tests
* Refactor vision config + docs
* Fix default
* Refactor text config
* Doc fixes
* Remove unused args, fix docs example
* Squashed commit of the following:
commit b51ce5a2efffbecdefbf6fc92ee87372ec9d8830
Author: qubvel <qubvel@gmail.com>
Date: Wed Sep 18 13:39:15 2024 +0000
Move model + add output hidden states and output attentions
* Fix num_channels
* Add mllama text and mllama vision models
* Fixing repo consistency
* Style fix
* Fixing repo consistency
* Fixing unused config params
* Fix failed tests after refactoring
* hidden_activation -> hidden_act for text mlp
* Remove from_pretrained from sub-configs
* Apply suggestions from code review
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
* Update src/transformers/models/mllama/convert_mllama_weights_to_hf.py
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
* Reuse lambda in conversion script
* Remove run.py
* Update docs/source/en/model_doc/mllama.md
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
* Update src/transformers/models/mllama/processing_mllama.py
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
* Remove unused LlamaTokenizerFast
* Fix logging
* Refactor gating
* Remove cycle for collecting intermediate states
* Refactor text-only check, add integration test for text-only
* Revert from pretrained to configs
* Fix example
* Add auto `bos_token` adding in processor
* Fix tips
* Update src/transformers/models/auto/tokenization_auto.py
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
* Enable supports_gradient_checkpointing model flag
* add eager/sdpa options
* don't skip attn tests and bring back GC skips (did i really remove those?)
* Fix signature, but get error with None gradient
* Fix output attention tests
* Disable GC back
* Change no split modules
* Fix dropout
* Style
* Add Mllama to sdpa list
* Add post init for vision model
* Refine config for MllamaForCausalLMModelTest and skipped tests for CausalLM model
* if skipped, say it, don't pass
* Clean vision tester config
* Doc for args
* Update tests/models/mllama/test_modeling_mllama.py
Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
* Add cross_attention_mask to test
* typehint
* Remove todo
* Enable gradient checkpointing
* Docstring
* Style
* Fixing and skipping some tests for new cache
* Mark flaky test
* Skip `test_sdpa_can_compile_dynamic` test
* Fixing some offload tests
* Add direct GenerationMixin inheritance
* Remove unused code
* Add initializer_range to vision config
* update the test to make sure we show if split
* fix gc?
* Fix repo consistency
* Undo modeling utils debug changes
* Fix link
* mllama -> Mllama
* [mllama] -> [Mllama]
* Enable compile test for CausalLM model (text-only)
* Fix TextModel prefix
* Update doc
* Docs for forward, type hints, and vision model prefix
* make sure to reset
* fix init
* small script refactor and styling
* nit
* updates!
* some nits
* Interpolate embeddings for 560 size and update integration tests
* nit
* does not suppor static cache!
* update
* fix
* nit2
* this?
* Fix conversion
* Style
* 4x memory improvement with image cache AFAIK
* Token decorator for tests
* Skip failing tests
* update processor errors
* fix split issues
* style
* weird
* style
* fix failing tests
* update
* nit fixing the whisper tests
* fix path
* update
---------
Co-authored-by: raushan <raushan@huggingface.co>
Co-authored-by: pavel <ubuntu@ip-10-90-0-11.ec2.internal>
Co-authored-by: qubvel <qubvel@gmail.com>
Co-authored-by: Pablo Montalvo <39954772+molbap@users.noreply.github.com>
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
2024-09-25 19:56:25 +02:00
..
2024-09-03 14:01:00 +01:00
2024-09-24 21:28:19 -04:00
2023-11-03 10:57:03 -04:00
2024-05-16 10:56:11 +01:00
2024-03-20 15:41:03 +00:00
2023-11-03 10:57:03 -04:00
2023-12-09 05:38:14 +09:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-02-16 08:16:58 +01:00
2023-11-03 10:57:03 -04:00
2024-04-26 16:23:44 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-20 14:27:32 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-08-27 18:50:27 +01:00
2024-06-04 18:29:45 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2024-09-24 03:40:56 -06:00
2023-11-03 10:57:03 -04:00
2023-11-06 19:45:03 +00:00
2024-07-18 10:30:37 +05:30
2024-09-09 10:47:24 +02:00
2023-11-10 13:49:10 +00:00
2024-09-09 10:47:24 +02:00
2024-04-17 12:19:18 +02:00
2024-03-15 14:29:11 +01:00
2024-05-08 11:42:07 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-08-19 10:21:51 +01:00
2023-11-03 10:57:03 -04:00
2024-05-27 14:57:43 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-05-08 11:42:07 +01:00
2024-05-16 10:56:11 +01:00
2023-11-03 10:57:03 -04:00
2024-07-05 19:28:41 +01:00
2024-07-05 19:28:41 +01:00
2024-05-28 18:07:07 +01:00
2024-09-02 17:19:18 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-08-19 09:28:13 +01:00
2024-02-16 08:16:58 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-23 17:44:08 +00:00
2024-05-28 18:07:07 +01:00
2023-06-20 18:07:47 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-02-16 08:16:58 +01:00
2024-05-28 18:07:07 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2023-09-04 17:18:34 +01:00
2024-03-29 14:31:31 +00:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-24 21:28:19 -04:00
2024-08-07 10:03:05 +05:00
2024-05-20 10:06:57 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-06-19 09:40:57 +02:00
2024-02-16 08:16:58 +01:00
2023-12-09 05:38:14 +09:00
2023-11-03 10:57:03 -04:00
2024-06-26 13:56:36 +01:00
2024-01-15 09:09:22 +01:00
2023-11-03 10:57:03 -04:00
2024-05-28 18:07:07 +01:00
2024-08-27 21:27:21 +02:00
2024-09-21 01:43:50 +02:00
2024-05-28 18:07:07 +01:00
2024-07-25 19:20:47 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2024-04-22 18:30:38 +01:00
2023-11-03 10:57:03 -04:00
2024-05-21 19:38:02 +02:00
2024-05-13 15:59:46 +01:00
2023-11-03 10:57:03 -04:00
2024-02-02 08:45:00 +01:00
2024-06-25 15:45:39 +05:00
2024-06-25 15:45:39 +05:00
2024-09-09 10:47:24 +02:00
2024-05-14 16:32:01 +02:00
2024-05-28 18:07:07 +01:00
2023-10-30 21:42:19 +01:00
2023-11-03 10:57:03 -04:00
2024-02-12 10:48:31 -08:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-02-12 10:48:31 -08:00
2023-12-20 14:25:07 +05:30
2024-09-12 11:24:56 +02:00
2024-05-20 10:06:57 +02:00
2024-09-24 03:40:56 -06:00
2024-09-24 21:28:19 -04:00
2024-09-24 03:40:56 -06:00
2024-07-19 10:08:56 +05:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-25 18:04:42 +01:00
2023-11-28 13:19:50 +00:00
2024-08-26 17:49:44 +02:00
2024-03-11 09:46:24 +01:00
2024-07-22 14:14:47 +01:00
2024-02-02 08:45:00 +01:00
2024-05-31 16:56:17 +01:00
2024-05-31 16:56:17 +01:00
2024-09-09 10:47:24 +02:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2024-05-28 18:07:07 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-02-08 14:13:35 -08:00
2024-09-18 19:23:44 +02:00
2024-05-23 17:48:49 +01:00
2024-09-24 03:40:56 -06:00
2024-09-25 19:56:25 +02:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2023-11-06 19:45:03 +00:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2024-02-01 03:53:49 +01:00
2024-03-18 13:06:12 +00:00
2024-02-12 10:48:31 -08:00
2023-11-03 10:57:03 -04:00
2024-05-28 18:07:07 +01:00
2024-08-06 15:42:05 +02:00
2024-05-28 18:07:07 +01:00
2023-11-06 19:45:03 +00:00
2024-09-25 18:04:42 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-04-17 17:59:07 +02:00
2024-09-05 15:49:28 +02:00
2024-09-25 13:26:28 -04:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2023-12-09 05:38:14 +09:00
2024-05-14 08:36:11 +02:00
2023-12-11 18:03:42 +00:00
2024-09-19 14:14:06 -04:00
2024-02-19 15:22:29 +01:00
2024-02-19 15:22:29 +01:00
2024-02-08 14:13:35 -08:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-05-20 10:06:57 +02:00
2024-05-02 15:30:21 +02:00
2024-04-15 14:10:59 +02:00
2024-09-09 10:47:24 +02:00
2024-02-26 08:42:24 -08:00
2024-09-25 13:53:12 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-02-12 10:48:31 -08:00
2024-07-09 10:38:29 +01:00
2024-03-13 19:05:20 +00:00
2024-02-08 14:13:35 -08:00
2024-05-28 18:07:07 +01:00
2024-08-08 15:47:24 +02:00
2024-05-20 10:06:57 +02:00
2024-09-12 18:24:04 +02:00
2024-07-24 11:54:41 +01:00
2023-11-03 10:57:03 -04:00
2024-05-28 18:07:07 +01:00
2024-04-15 18:30:59 +02:00
2024-02-02 08:45:00 +01:00
2023-11-06 19:45:03 +00:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-07-13 11:46:54 -04:00
2023-11-06 19:45:03 +00:00
2024-07-22 10:08:27 -07:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-07-10 16:34:53 +01:00
2024-02-02 08:45:00 +01:00
2024-08-12 20:20:17 +01:00
2023-12-14 15:14:13 +00:00
2023-12-14 15:14:13 +00:00
2024-06-10 12:35:10 +01:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-07-08 11:10:02 +01:00
2024-05-28 18:07:07 +01:00
2023-11-03 10:57:03 -04:00
2024-02-16 08:16:58 +01:00
2023-08-03 14:12:07 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-05-20 10:06:57 +02:00
2024-05-20 10:06:57 +02:00
2024-05-28 13:22:06 +02:00
2024-04-19 18:31:43 +01:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-06 19:45:03 +00:00
2024-04-15 14:10:59 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-06 19:45:03 +00:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-02-16 08:16:58 +01:00
2023-11-03 10:57:03 -04:00
2024-05-28 18:07:07 +01:00
2023-11-23 17:02:16 +00:00
2024-04-10 16:02:50 +02:00
2023-11-03 10:57:03 -04:00
2024-02-02 08:45:00 +01:00
2024-02-02 08:45:00 +01:00
2023-11-03 10:57:03 -04:00
2023-11-22 17:21:36 +01:00
2023-11-03 10:57:03 -04:00
2024-02-02 08:45:00 +01:00
2024-09-24 03:40:56 -06:00
2024-05-16 10:56:11 +01:00
2023-11-03 10:57:03 -04:00
2024-07-19 10:08:56 +05:00
2024-02-16 08:16:58 +01:00
2023-11-03 10:57:03 -04:00
2024-02-16 08:16:58 +01:00
2024-05-28 18:07:07 +01:00
2024-05-16 10:56:11 +01:00
2024-05-16 10:56:11 +01:00
2024-06-11 15:47:38 +01:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-01-18 13:37:34 +00:00
2024-06-05 11:56:11 +01:00
2024-06-05 11:56:11 +01:00
2024-02-02 08:45:00 +01:00
2024-08-27 14:11:52 +02:00
2024-05-28 18:07:07 +01:00
2023-11-03 10:57:03 -04:00
2024-05-28 18:07:07 +01:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2023-11-03 10:57:03 -04:00
2024-09-09 10:47:24 +02:00
2023-11-03 10:57:03 -04:00
2024-06-05 11:56:11 +01:00
2023-11-03 10:57:03 -04:00
2024-05-16 10:56:11 +01:00
2023-11-03 10:57:03 -04:00
2024-07-08 11:43:33 +02:00