Skip to content

LLM inference in C/C++

C++ ggml

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

Toki Nasin9adc7f420c37
diff --git a/conversion/plamo.py b/conversion/plamo.py
index 31c6455aaf..52055e4a16 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()