Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
ngxson committed Aug 20, 2024
1 parent cef2c97 commit f3a3033
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions convert_lora_to_gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,11 @@ def get_tensors(self) -> Iterator[tuple[str, Tensor]]:
yield (name, cast(torch.Tensor, LoraTorchTensor(tensor.A, tensor.B)))

def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
dest = super().modify_tensors(data_torch, name, bid)
dest = list(super().modify_tensors(data_torch, name, bid))
# for now, we cannot convert archs that use the same tensor for tok_embd and output
# see: https://github.com/ggerganov/llama.cpp/issues/9065
if name == "lm_head.weight" and len(dest) == 0:
raise ValueError(f"lm_head is present in adapter, but is ignored in base model")
raise ValueError("lm_head is present in adapter, but is ignored in base model")
for dest_name, dest_data in dest:
assert isinstance(dest_data, LoraTorchTensor)
lora_a, lora_b = dest_data.get_lora_A_B()
Expand Down

0 comments on commit f3a3033

Please sign in to comment.