Skip to content

Commit 0fde324

Browse files
fix variantfp16 error for diffusers (#156)
1 parent 33bb22e commit 0fde324

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/invoke_training/_shared/stable_diffusion/model_loading_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ def from_pretrained_with_variant_fallback(
9494
variant=variant_to_try,
9595
**kwargs,
9696
)
97-
except OSError as e:
98-
if "no file named" in str(e):
97+
except (OSError, ValueError) as e:
98+
error_str = str(e)
99+
if "no file named" in error_str or "no such modeling files are available" in error_str:
99100
# Ok; we'll try the variant fallbacks.
100101
logger.warning(f"Failed to load '{model_name_or_path}' with variant '{variant_to_try}'. Error: {e}.")
101102
else:

0 commit comments

Comments
 (0)