File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments