Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

support new "longrope" attention factor

Bruce MacDonaldaec77d6a05c3
diff --git a/convert/convert_phi3.go b/convert/convert_phi3.go
index 7aa3ed150..0f645217d 100644
--- a/convert/convert_phi3.go
+++ b/convert/convert_phi3.go
@@ -58,7 +58,7 @@ func (p *phi3) KV(t *Tokenizer) llm.KV {
switch p.RopeScaling.Type {
case "":
// no scaling
- case "su":
+ case "su", "longrope":
kv["phi3.rope.scaling.attn_factor"] = float32(max(math.Sqrt(1+math.Log(scale)/math.Log(float64(p.OriginalMaxPositionEmbeddings))), 1.0))
case "yarn":
kv["phi3.rope.scaling.attn_factor"] = float32(max(0.1*math.Log(scale)+1.0, 1.0))