diff --git a/python/sglang/srt/hf_transformers_utils.py b/python/sglang/srt/hf_transformers_utils.py index fb4635558..224b1396b 100644 --- a/python/sglang/srt/hf_transformers_utils.py +++ b/python/sglang/srt/hf_transformers_utils.py @@ -73,6 +73,8 @@ def get_context_length(config): rope_scaling = getattr(config, "rope_scaling", None) if rope_scaling: rope_scaling_factor = config.rope_scaling["factor"] + if "original_max_position_embeddings" in rope_scaling: + rope_scaling_factor = 1 if config.rope_scaling.get("rope_type", None) == "llama3": rope_scaling_factor = 1 else: