Skip to content

Commit a6b6219

Browse files
committed
model : print warning only if n_swa > 0
1 parent b68f3f6 commit a6b6219

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/llama-model.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -853,14 +853,18 @@ void llama_model::load_hparams(llama_model_loader & ml) {
853853
default: type = LLM_TYPE_UNKNOWN;
854854
}
855855

856-
LLAMA_LOG_WARN("%s: Phi SWA is currently disabled - results might be suboptimal for some models (see %s)\n",
857-
__func__, "https://github.com/ggml-org/llama.cpp/pull/13676");
856+
const bool found_swa = ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW, hparams.n_swa, false);
858857

859-
// TODO: fix conversion scripts to correctly populate `n_swa` and `n_swa_pattern`
860-
hparams.swa_type = LLAMA_SWA_TYPE_NONE;
858+
if (found_swa && hparams.n_swa > 0) {
859+
LLAMA_LOG_WARN("%s: Phi SWA is currently disabled - results might be suboptimal for some models (see %s)\n",
860+
__func__, "https://github.com/ggml-org/llama.cpp/pull/13676");
861861

862-
hparams.n_swa = 0;
863-
hparams.n_swa_pattern = 1;
862+
// TODO: fix conversion scripts to correctly populate `n_swa` and `n_swa_pattern`
863+
hparams.swa_type = LLAMA_SWA_TYPE_NONE;
864+
865+
hparams.n_swa = 0;
866+
hparams.n_swa_pattern = 1;
867+
}
864868
} break;
865869
case LLM_ARCH_PHIMOE:
866870
{

0 commit comments

Comments
 (0)