Skip to content

Conversation

@DN6
Copy link
Collaborator

@DN6 DN6 commented Oct 20, 2025

What does this PR do?

check_imports in dynamic_module_utils doesn't account for guarded imports in custom code. Instead of diffusers raising an error, we should just raise a warning to let the user know that modules might be missing. The custom code will error out on loading anyway if a needed module is missing. We shouldn't raise errors on our side due inaccurate parsing/interpretation of the code.

This issue doesn't seem to happen when loading custom code directly from a local directory. I haven't investigated much further, but seems to imply that dynamic module loading might need a bit of work to be more robust/consistent.

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@DN6 DN6 requested a review from yiyixuxu October 20, 2025 12:28
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@yiyixuxu yiyixuxu merged commit 4830575 into main Oct 20, 2025
15 checks passed
@yiyixuxu yiyixuxu deleted the dynamic-import-fix branch October 20, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants