refactor(lora): make the fused chunk slicer public

The fidelity CLI slices fused saves the way try_load_lora does.
This commit is contained in:
CalamitousFelicitousness
2026-09-15 03:52:04 +01:00
parent 5860ea9153
commit a0f0097e52
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -370,7 +370,7 @@ def native_mapping(state_dict, network_alpha=None):
if 'lora_down.weight' not in w or 'lora_up.weight' not in w:
continue
for path, chunk in native_adapter.resolve_group_targets(M.resolve_targets, prefix, base):
target = native_adapter._slice_lora_chunk(w, chunk) if chunk is not None else w # pylint: disable=protected-access
target = native_adapter.slice_lora_chunk(w, chunk) if chunk is not None else w
alpha = network_alpha if 'alpha' not in target else float(target['alpha'])
scale = 1.0 if alpha is None else alpha / target['lora_down.weight'].shape[0]
out[path] = (target['lora_down.weight'], target['lora_up.weight'], scale)