Update save.py
This commit is contained in:
parent
58d1f1e03c
commit
f0a3c05b07
1 changed files with 4 additions and 2 deletions
|
|
@ -90,12 +90,14 @@ def _merge_lora(layer, name):
|
|||
W = fast_dequantize(W, quant_state)
|
||||
else:
|
||||
dtype = W.dtype
|
||||
W = W.to(torch.float32).t()
|
||||
# W = W.to(torch.float32).t()
|
||||
W = W.t()
|
||||
|
||||
if A is not None:
|
||||
# sAB = (A.t().to(torch.float32) @ (s * B.t().to(torch.float32)))
|
||||
# W += sAB
|
||||
W.addmm_(A.t().to(torch.float32), B.t().to(torch.float32), alpha = s)
|
||||
# W.addmm_(A.t().to(torch.float32), B.t().to(torch.float32), alpha = s)
|
||||
W.addmm_(A.t(), B.t(), alpha = s)
|
||||
# if not torch.isfinite(W).all():
|
||||
maximum_element = torch.max(W.min().abs(), W.max())
|
||||
if not torch.isfinite(maximum_element).item():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue