Skip to content

Commit 2c8dac7

Browse files
authored
llama : fix incorrect model type for Gemma 270M (#15764)
This commit fixes the model type for the Gemma 270M model in llama_model.cpp which should be LLM_TYPE_270M. I incorrectly added this previously as LLM_TYPE_537M which was wrong. The motivation for this is that it causes the model to not be identified properly when using tools like llama-bench. For example: ```console $ ./build/bin/llama-bench -m models/gemma-3-270m-Q8_0.gguf | model | size | ... | ------------------------------ | ---------: | ... | gemma3 ?B Q8_0 | 271.81 MiB | ... | gemma3 ?B Q8_0 | 271.81 MiB | ... ``` With the changes in this commit the output will be: ```console $ ./build/bin/llama-bench -m models/gemma-3-270m-Q8_0.gguf | model | size | ... | ------------------------------ | ---------: | ... | gemma3 270M Q8_0 | 271.81 MiB | ... | gemma3 270M Q8_0 | 271.81 MiB | ... ```
1 parent 40a751e commit 2c8dac7

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/llama-model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ void llama_model::load_hparams(llama_model_loader & ml) {
11101110
ml.get_key(LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, hparams.f_norm_rms_eps);
11111111

11121112
switch (hparams.n_layer) {
1113-
case 18: type = LLM_TYPE_537M; break;
1113+
case 18: type = LLM_TYPE_270M; break;
11141114
case 26: type = LLM_TYPE_1B; break;
11151115
case 34: type = LLM_TYPE_4B; break;
11161116
case 48: type = LLM_TYPE_12B; break;

src/llama-model.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ enum llm_type {
3939
LLM_TYPE_410M,
4040
LLM_TYPE_450M,
4141
LLM_TYPE_475M,
42-
LLM_TYPE_537M,
4342
LLM_TYPE_558M,
4443
LLM_TYPE_700M,
4544
LLM_TYPE_770M,

0 commit comments

Comments
 (0)