From 08da4c261888f7f2e09c434b85b8ed027b08b40e Mon Sep 17 00:00:00 2001 From: Alison Shao <54658187+alisonshao@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:16:00 -0800 Subject: [PATCH] [Bugfix] Fix KeyError for Mistral-Large-3 rope_scaling config (#14627) --- python/sglang/srt/configs/model_config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/configs/model_config.py b/python/sglang/srt/configs/model_config.py index 6483487fd..33938ff48 100644 --- a/python/sglang/srt/configs/model_config.py +++ b/python/sglang/srt/configs/model_config.py @@ -358,9 +358,10 @@ class ModelConfig: mscale_all_dim = self.hf_config.rope_scaling.get( "mscale_all_dim", False ) - scaling_factor = self.hf_config.rope_scaling["factor"] - mscale = yarn_get_mscale(scaling_factor, float(mscale_all_dim)) - self.scaling = self.scaling * mscale * mscale + scaling_factor = self.hf_config.rope_scaling.get("factor") + if scaling_factor is not None: + mscale = yarn_get_mscale(scaling_factor, float(mscale_all_dim)) + self.scaling = self.scaling * mscale * mscale elif "MiniCPM3ForCausalLM" in self.hf_config.architectures: self.head_dim = 128