diff --git a/convert_hf_to_gguf.py b/convert_hf_to_gguf.py index 59410d6ce..2766fea37 100755 --- a/convert_hf_to_gguf.py +++ b/convert_hf_to_gguf.py @@ -2078,6 +2078,7 @@ class Phi3MiniModel(Model): self.gguf_writer.add_rope_dimension_count(rope_dims) self.gguf_writer.add_rope_freq_base(self.find_hparam(["rope_theta"])) self.gguf_writer.add_file_type(self.ftype) + self.gguf_writer.add_sliding_window(self.find_hparam(["sliding_window"])) # write rope scaling for long context (128k) model rope_scaling = self.find_hparam(['rope_scaling'], True) diff --git a/src/llama.cpp b/src/llama.cpp index 1df81eb9c..b6d6e1500 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -4974,8 +4974,7 @@ static void llm_load_hparams( } break; case LLM_ARCH_PHI3: { - hparams.n_swa = 2048; - ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW, hparams.n_swa, false); + ml.get_key(LLM_KV_ATTENTION_SLIDING_WINDOW, hparams.n_swa); ml.get_key(LLM_KV_ATTENTION_LAYERNORM_RMS_EPS, hparams.f_norm_rms_eps); switch (hparams.n_layer) {