Commit 9adc7f420 for llama.cpp

commit 9adc7f420c37641921b32e326b3d4a538256b878
Author: Toki Nasin <141258697+tokinasin@users.noreply.github.com>
Date:   Sun Sep 27 20:45:47 2026 +0900

    convert : export YaRN scaling parameters for PLaMo-3 (#29528)

    Recent PLaMo-3 models use YaRN, while some earlier PLaMo-3 models do not.
    The recent PLaMo-3 store their YaRN settings as flat config keys
    (rope_scaling_factor, initial_context_length) and build the dict at runtime
    in Plamo3Config.rope_parameters. The current converter misses these settings
    and writes plain RoPE metadata to GGUF. Mirror the runtime settings into
    rope_parameters so the corresponding rope.scaling.* is written to GGUF.

diff --git a/conversion/plamo.py b/conversion/plamo.py
index 31c6455aa..52055e4a1 100644
--- a/conversion/plamo.py
+++ b/conversion/plamo.py
@@ -154,6 +154,21 @@ class Plamo2Model(TextModel):
 class Plamo3Model(TextModel):
     model_arch = gguf.MODEL_ARCH.PLAMO3

+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+
+        # PLaMo-3 builds rope_parameters from flat config keys at runtime; mirror the YaRN settings for GGUF.
+        rope_scaling_factor = self.hparams.get("rope_scaling_factor", 1)
+        if rope_scaling_factor != 1 and "rope_type" not in self.rope_parameters:
+            self.rope_parameters.update({
+                "rope_type": "yarn",
+                "factor": float(rope_scaling_factor),
+                "original_max_position_embeddings": int(self.hparams["initial_context_length"]),
+                "beta_fast": 32.0,
+                "beta_slow": 1.0,
+                "truncate": False,
+            })
+
     def set_vocab(self):
         self._set_vocab_plamo()