Files
HuggingFace_transformer/tests/models
Jack Morris 832c6191ed Add inputs_embeds param to ModernBertModel (#35373)
* update modular_modernbert -- add inputs_embeds param to ModernBertModel

* Fix implementation issues; extend to other classes; docstring

First of all, the inputs_embeds shouldn't fully replace `self.embeddings(input_ids)`, because this call also does layer normalization and dropout. So, now both input_ids and inputs_embeds is passed to the ModernBertEmbeddings, much like how BertEmbeddings is implemented.

I also added `inputs_embeds` to the docstring, and propagated the changes to the other model classes.

I also introduced an error if input_ids and input_embeds are both or neither provided.

Lastly, I fixed an issue with device being based solely on input_ids with attention_mask.

* Propagate inputs_embeds to ModernBertForMaskedLM correctly

Also reintroduce inputs_embeds test

---------

Co-authored-by: Tom Aarsen <Cubiegamedev@gmail.com>
2025-01-09 14:17:26 +01:00
..
2024-12-20 14:36:31 +01:00
2024-12-18 20:18:17 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-12-17 14:44:47 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-12-13 09:35:50 +01:00
2024-12-13 09:35:50 +01:00
2024-12-17 11:26:43 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-12-17 14:44:47 +01:00
2025-01-07 11:34:56 +01:00
2024-06-26 21:59:08 +01:00
2024-09-21 01:58:00 +01:00
2024-12-18 16:53:39 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-12-18 16:53:39 +01:00
2024-12-20 14:36:31 +01:00
2024-06-26 21:59:08 +01:00
2024-05-22 06:40:15 +02:00
2024-12-18 16:53:39 +01:00
2024-12-20 14:36:31 +01:00
2024-12-18 16:53:39 +01:00
2024-12-20 14:36:31 +01:00
2024-12-19 17:05:25 +01:00
2024-12-19 17:05:25 +01:00
2024-06-26 21:59:08 +01:00
2024-12-20 14:36:31 +01:00
2024-12-20 14:36:31 +01:00
2024-06-26 21:59:08 +01:00
2024-12-19 17:05:25 +01:00
2025-01-08 10:35:23 +01:00
2025-01-08 10:35:23 +01:00
2025-01-08 10:35:23 +01:00
2024-10-22 08:23:53 +02:00
2024-12-20 14:36:31 +01:00
2024-12-20 14:36:31 +01:00
2024-06-26 21:59:08 +01:00
2024-12-18 16:53:39 +01:00
2024-12-18 16:53:39 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-10-07 10:56:24 +02:00
2024-06-26 21:59:08 +01:00
2024-12-20 14:36:31 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-06-26 21:59:08 +01:00
2024-12-18 16:53:39 +01:00
2024-12-18 16:53:39 +01:00
2025-01-09 11:09:09 +01:00
2024-10-04 22:45:37 +02:00
2024-06-26 21:59:08 +01:00
2024-12-18 16:53:39 +01:00
2024-12-18 16:53:39 +01:00
2024-12-20 14:36:31 +01:00
2024-12-23 13:54:57 +01:00
2024-12-18 16:53:39 +01:00
2024-12-20 14:36:31 +01:00
2025-01-08 09:52:51 +01:00
2024-06-26 21:59:08 +01:00
2024-11-29 11:58:11 +00:00
2025-01-08 10:35:23 +01:00
2025-01-08 10:35:23 +01:00
2024-05-22 06:40:15 +02:00
2024-06-26 21:59:08 +01:00
2025-01-08 16:02:14 +00:00
2025-01-08 16:02:14 +00:00
2024-10-15 11:27:54 +02:00
2024-12-18 14:13:21 +01:00
2024-06-26 21:59:08 +01:00
2022-05-03 14:42:02 +02:00