convert : map the Inkling-2 LoRA tensor names (#33055)

PEFT names the wrapped projections (self_attn.k_proj.linear.weight) and the attention output gate (self_attn.o_proj.gate_proj.weight); neither is in the Inkling-2 tensor map, so convert_lora_to_gguf.py stops with 'Can not map tensor'. Strip the .linear. segment and map the gate to ATTN_GATE.

Co-authored-by: Sergio Sanchez <sergiosv96@users.noreply.github.com>
This commit is contained in:
Sergio Sánchez Vallés 2026-11-25 20:49:09 +01:00 • committed by GitHub
parent 8d35ba4f7b
commit 5917b39ff7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -248,6 +248,12 @@ class Inkling2Model(TextModel):
return super().tensor_force_quant(name, new_name, bid, n_dims)
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
# PEFT names the wrapped projections (self_attn.k_proj.linear.weight) and the attention
# output gate (self_attn.o_proj.gate_proj.weight); neither is in the tensor map.
name = name.replace(".linear.", ".")
if name.endswith(".o_proj.gate_proj.weight"):
yield self.format_tensor_name(gguf.MODEL_TENSOR.ATTN_GATE, bid), data_torch
return
if name in self._packed_experts:
target = name.replace(".w13_weight", ".gate_up_proj").replace(".w2_weight", ".down_proj")
yield self.map_tensor_name(target, try_suffixes=()) + ".weight", cast("Tensor", self._packed_experts[name])