fix: Free cpu_base after storing to avoid duplicate RAM usage
This commit is contained in:
@@ -1790,12 +1790,15 @@ def merge_loras_to_model(
|
||||
else:
|
||||
# No LoRA contribution, copy as-is
|
||||
output_sd[base_key] = cpu_base.to(save_dtype).contiguous()
|
||||
del cpu_base
|
||||
stats["copied"] += 1
|
||||
else:
|
||||
# Non-weight tensor (bias, norm, etc.), copy as-is
|
||||
output_sd[base_key] = cpu_base.to(save_dtype).contiguous()
|
||||
del cpu_base
|
||||
stats["copied"] += 1
|
||||
|
||||
|
||||
pbar.update(1)
|
||||
|
||||
if verbose:
|
||||
|
||||
Reference in New Issue
Block a user