hparams : support models for which all layers use SWA (#13682)

ggml-ci
This commit is contained in:
Georgi Gerganov
2025-05-21 20:00:49 +03:00
committed by GitHub
parent 5fbfe384d4
commit 8e186ef0e7
2 changed files with 13 additions and 2 deletions

View File

@ -72,7 +72,7 @@ uint32_t llama_hparams::n_embd_v_s() const {
bool llama_hparams::is_swa(uint32_t il) const {
if (il < n_layer) {
return n_swa > 0 && n_swa_pattern > 0 && il % n_swa_pattern < (n_swa_pattern - 1);
return n_swa_pattern == 0 || (il % n_swa_pattern < (n_swa_pattern - 1));
}
GGML_ABORT("fatal error");