Skip to content

Commit e2044f6

Browse files
committed
rwkv7: Add some model type variants
Signed-off-by: Molly Sophia <[email protected]>
1 parent 1416fd0 commit e2044f6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/llama-model.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const char * llm_type_name(llm_type type) {
2626
case LLM_TYPE_109M: return "109M";
2727
case LLM_TYPE_137M: return "137M";
2828
case LLM_TYPE_160M: return "160M";
29+
case LLM_TYPE_190M: return "190M";
2930
case LLM_TYPE_220M: return "220M";
3031
case LLM_TYPE_250M: return "250M";
3132
case LLM_TYPE_270M: return "270M";
@@ -1223,7 +1224,15 @@ void llama_model::load_hparams(llama_model_loader & ml) {
12231224
ml.get_key(LLM_KV_TOKEN_SHIFT_COUNT, hparams.token_shift_count, false);
12241225

12251226
switch (hparams.n_layer) {
1226-
case 28: type = LLM_TYPE_7B; break; // ARWKV7
1227+
case 12: type = LLM_TYPE_190M; break;
1228+
case 24:
1229+
switch (hparams.n_embd) {
1230+
case 1024: type = LLM_TYPE_450M; break;
1231+
case 2048: type = LLM_TYPE_1_5B; break;
1232+
default: type = LLM_TYPE_UNKNOWN;
1233+
} break;
1234+
break;
1235+
case 28: type = LLM_TYPE_7B; break; // ARWKV7
12271236
default: type = LLM_TYPE_UNKNOWN;
12281237
}
12291238
} break;

src/llama-model.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ enum llm_type {
2525
LLM_TYPE_109M,
2626
LLM_TYPE_137M,
2727
LLM_TYPE_160M,
28+
LLM_TYPE_190M,
2829
LLM_TYPE_220M,
2930
LLM_TYPE_250M,
3031
LLM_TYPE_270M,

0 commit comments

Comments
 (0)