Skip to content

Commit 22bff1f

Browse files
committed
Fix conditional within filter_by_variant to not read all candidates as default
1 parent 55ba648 commit 22bff1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

invokeai/backend/model_manager/util/select_hf_files.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ def _filter_by_variant(files: List[Path], variant: ModelRepoVariant) -> Set[Path
130130
# Some special handling is needed here if there is not an exact match and if we cannot infer the variant
131131
# from the file name. In this case, we only give this file a point if the requested variant is FP32 or DEFAULT.
132132
if (
133-
candidate_variant_label
133+
variant is not ModelRepoVariant.Default
134+
and candidate_variant_label
134135
and candidate_variant_label.startswith(f".{variant.value}")
135-
or (not candidate_variant_label and variant in [ModelRepoVariant.FP32, ModelRepoVariant.Default])
136-
):
136+
) or (not candidate_variant_label and variant in [ModelRepoVariant.FP32, ModelRepoVariant.Default]):
137137
score += 1
138138

139139
if parent not in subfolder_weights:

0 commit comments

Comments
 (0)