Skip to content

Commit 4830575

Browse files
authored
Raise warning instead of error when imports are missing for custom code (huggingface#12513)
update
1 parent 7853bfb commit 4830575

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/utils/dynamic_modules_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ def check_imports(filename):
151151
missing_packages.append(imp)
152152

153153
if len(missing_packages) > 0:
154-
raise ImportError(
155-
"This modeling file requires the following packages that were not found in your environment: "
154+
logger.warning(
155+
"This modeling file might require the following packages that were not found in your environment: "
156156
f"{', '.join(missing_packages)}. Run `pip install {' '.join(missing_packages)}`"
157157
)
158158

0 commit comments

Comments
 (0)