mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
remove unnecessary device change
This commit is contained in:
@@ -80,8 +80,6 @@ def merge_lora_models(models, ratios, new_rank, new_conv_rank, device, merge_dty
|
|||||||
|
|
||||||
if device: # and isinstance(scale, torch.Tensor):
|
if device: # and isinstance(scale, torch.Tensor):
|
||||||
scale = scale.to(device)
|
scale = scale.to(device)
|
||||||
up_weight = up_weight.to(device)
|
|
||||||
down_weight = down_weight.to(device)
|
|
||||||
|
|
||||||
if not conv2d: # linear
|
if not conv2d: # linear
|
||||||
weight = weight + ratio * (up_weight @ down_weight) * scale
|
weight = weight + ratio * (up_weight @ down_weight) * scale
|
||||||
|
|||||||
Reference in New Issue
Block a user