Skip to content

Commit 3466c6e

Browse files
authored
llama : add more qwen2 models (#5071)
1 parent 504dc37 commit 3466c6e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llama.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,8 +1325,10 @@ static llama_state g_state;
13251325
// available llama models
13261326
enum e_model {
13271327
MODEL_UNKNOWN,
1328+
MODEL_0_5B,
13281329
MODEL_1B,
13291330
MODEL_3B,
1331+
MODEL_4B,
13301332
MODEL_7B,
13311333
MODEL_8B,
13321334
MODEL_13B,
@@ -2892,9 +2894,9 @@ static void llm_load_hparams(
28922894
{
28932895
ml.get_key(LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, hparams.f_norm_rms_eps);
28942896
switch (hparams.n_layer) {
2895-
case 24: model.type = e_model::MODEL_1B; break;
2897+
case 24: model.type = hparams.n_embd == 1024 ? e_model::MODEL_0_5B : e_model::MODEL_1B; break;
28962898
case 32: model.type = e_model::MODEL_7B; break;
2897-
case 40: model.type = e_model::MODEL_13B; break;
2899+
case 40: model.type = hparams.n_head == 20 ? e_model::MODEL_4B : e_model::MODEL_13B; break;
28982900
case 80: model.type = e_model::MODEL_70B; break;
28992901
default: model.type = e_model::MODEL_UNKNOWN;
29002902
}

0 commit comments

Comments
 (0)