fix: Free cpu_base after storing to avoid duplicate RAM usage

This commit is contained in:
silveroxides
2026-01-15 02:51:17 +01:00
parent cffb92aa06
commit e9f7cda706
+3
View File
@@ -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: