File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -967,11 +967,19 @@ def _save_or_select_or_merge(
967967 if unit_id in new_unit_ids :
968968 merge_unit_group = tuple (merge_unit_groups [new_unit_ids .index (unit_id )])
969969 if not mergeable [merge_unit_group ]:
970- raise Exception (
971- f"The sparsity of { merge_unit_group } do not overlap enough for a soft merge using "
972- f"a sparsity threshold of { sparsity_overlap } . You can either lower the threshold or use "
973- "a hard merge."
974- )
970+ # if someone wants soft mode we error if they try to use an inappropriate sparsity overlap
971+ # if hard mode we can still use a sparsity if all units have good sparsity overlap
972+ # but if any merge_unit_group doesn't have an overlap then we have to not use the old
973+ # sparsity and instead use a new sparsity
974+ if merging_mode == "soft" :
975+ raise Exception (
976+ f"The sparsity of { merge_unit_group } do not overlap enough for a soft merge using "
977+ f"a sparsity threshold of { sparsity_overlap } . You can either lower the threshold or use "
978+ "a hard merge."
979+ )
980+ else :
981+ sparsity = None
982+ break
975983 else :
976984 sparsity_mask [unit_index ] = masks [merge_unit_group ]
977985 else :
You can’t perform that action at this time.
0 commit comments