Skip to content

Commit

Permalink
Handle missing factor field in the rope scaling config
Browse files Browse the repository at this point in the history
  • Loading branch information
janimo authored and merrymercy committed Sep 3, 2024
1 parent 4e7182e commit e115fd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/sglang/srt/hf_transformers_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def get_context_length(config):
"""Get the context length of a model from a huggingface model configs."""
rope_scaling = getattr(config, "rope_scaling", None)
if rope_scaling:
rope_scaling_factor = config.rope_scaling["factor"]
rope_scaling_factor = config.rope_scaling.get("factor", 1)
if "original_max_position_embeddings" in rope_scaling:
rope_scaling_factor = 1
if config.rope_scaling.get("rope_type", None) == "llama3":
Expand Down

0 comments on commit e115fd6

Please sign in to comment.