Skip to content

Commit 4ba6527

Browse files
committed
Confirm LoRA bias is zero before ignoring
1 parent 91c7e55 commit 4ba6527

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lora.py

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def __init__(self, model, lora_config_path, lora_path):
5959
lora_half = ks[5]
6060

6161
if lora_half == "bias":
62+
epsilon = 1e-6
63+
if torch.max(tensor) > epsilon or torch.max(tensor) < -epsilon:
64+
raise ValueError(f" ## Error: unsupported bias target {self.lora_path}: {key}")
6265
self.bias_ignored = True
6366
continue
6467

test_benchmark_inference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def mem(name, total = False):
140140
sys.exit()
141141
lora = ExLlamaLora(model, args.lora_config, args.lora)
142142
if lora.bias_ignored:
143-
print(f" !! Warning: LoRA bias ignored")
143+
print(f" !! Warning: LoRA zero bias ignored")
144144

145145
# Test sequence
146146

0 commit comments

Comments
 (0)