Skip to content

Commit 2913e5f

Browse files
committed
double check swa
1 parent c8aeea5 commit 2913e5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/llama.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4912,7 +4912,10 @@ static void llm_load_hparams(
49124912
// default value for Phi-3-medium-128k-instruct
49134913
hparams.n_swa = 131072;
49144914
}
4915-
ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW, hparams.n_swa, false);
4915+
bool found_swa = ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW, hparams.n_swa, false);
4916+
if (!found_swa && hparams.n_swa == 0) {
4917+
throw std::runtime_error("invalid value for sliding_window");
4918+
}
49164919
} break;
49174920
case LLM_ARCH_PLAMO:
49184921
{

0 commit comments

Comments
 (0)