mlx-examples/llms/mlx_lm/models
Prince Canuma 2fce02acd8
Add support for Gemma3 (#1336)
* add support for gemma3

* fix model loading

* revert rmsnorm

* revert is sliding pattern

* revert

* add tests

* formatting

* Update llms/mlx_lm/models/gemma3_text.py

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

* Update llms/mlx_lm/models/gemma3_text.py

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

* Update llms/mlx_lm/models/gemma3_text.py

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

* Update llms/mlx_lm/models/gemma3_text.py

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

* Update llms/mlx_lm/models/gemma3_text.py

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

* Update llms/mlx_lm/models/gemma3_text.py

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

* Update llms/mlx_lm/models/gemma3_text.py

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>

* fix sliding window mask

---------

Co-authored-by: Awni Hannun <awni.hannun@gmail.com>
Co-authored-by: Awni Hannun <awni@apple.com>
2025-03-13 08:14:25 -07:00
..
__init__.py Mlx llm package (#301) 2024-01-12 10:25:56 -08:00
base.py use a bool mask for attention (#1319) 2025-03-04 12:47:32 -08:00
cache.py Fix rotating kv cache size (#1093) 2024-11-05 10:24:24 -08:00
cohere2.py Fix Cohere2: mask shape error (long context) (#1202) 2025-01-12 12:58:08 -08:00
cohere.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
dbrx.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
deepseek_v2.py fix sharding for more even number of layers (#1276) 2025-02-11 16:26:59 -08:00
deepseek_v3.py support kimi + more options in chat mode (#1312) 2025-02-28 11:33:18 -08:00
deepseek.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
exaone.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
gemma2.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
gemma3_text.py Add support for Gemma3 (#1336) 2025-03-13 08:14:25 -07:00
gemma.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
gpt2.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
gpt_bigcode.py fix gpt bigcode (#1204) 2025-01-13 10:22:32 -08:00
gpt_neox.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
granite.py Add IBM granite model (#1265) 2025-02-08 15:46:15 -08:00
helium.py Optimizations for mamba1 (#1213) 2025-02-03 13:36:08 -08:00
hunyuan.py support hunyuan 7b (#1263) 2025-02-08 15:46:47 -08:00
internlm2.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
internlm3.py add internlm3 (#1206) 2025-01-15 14:55:41 -08:00
llama.py remove lm head if unused (#1324) 2025-03-06 15:35:47 -08:00
mamba.py Optimizations for mamba1 (#1213) 2025-02-03 13:36:08 -08:00
minicpm.py Optimizations for mamba1 (#1213) 2025-02-03 13:36:08 -08:00
mixtral.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
nemotron.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
olmo2.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
olmo.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
olmoe.py adding OLMoE architecture (#1321) 2025-03-05 13:46:06 -08:00
openelm.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
phi3.py Fixes for phi4 mini (#1305) 2025-02-26 16:21:54 -08:00
phi3small.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
phi.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
phimoe.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
phixtral.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
plamo2.py Fix plamo2 model to use rms_norm (#1308) 2025-03-03 06:12:02 -08:00
plamo.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
qwen2_moe.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
qwen2.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
qwen.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
recurrent_gemma.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
rope_utils.py Adds EXAONE architecture. (#1145) 2024-12-09 07:58:25 -08:00
stablelm.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
starcoder2.py Length masking for batch inputs (#1173) 2024-12-18 19:43:52 -08:00
su_rope.py Fixes for phi4 mini (#1305) 2025-02-26 16:21:54 -08:00
switch_layers.py Handle longer prompt/generation (#931) 2024-08-16 15:28:39 -07:00