mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-11-26 23:29:34 +00:00
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:
parent
8d35ba4f7b
commit
5917b39ff7
1 changed files with 6 additions and 0 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue