fix rotary_embedding rope_scaling for phi (#3055)

This commit is contained in:
nstream-ai-devx
2025-01-22 23:45:32 +05:30
committed by GitHub
parent bf669606eb
commit 0d2148efaa

View File

@@ -1018,7 +1018,12 @@ def get_rope(
head_size, rotary_dim, max_position, base, is_neox_style, dtype
)
else:
scaling_type = rope_scaling["rope_type"]
if "rope_type" in rope_scaling:
scaling_type = rope_scaling["rope_type"]
elif "type" in rope_scaling:
scaling_type = rope_scaling["type"]
else:
raise ValueError("Unknown RoPE scaling type")
if scaling_type == "llama3":
scaling_factor = rope_scaling["factor"]