Uh oh!
There was an error while loading. Please reload this page.
Allow remote code repo names to contain "." - #11652
Conversation
sayakpaul
left a comment
There was a problem hiding this comment.
Looks pretty good! Should we add a test for it here?
diffusers/tests/pipelines/test_pipelines.py
Line 1009 in c934720
| def get_class_in_module(class_name, module_path): | ||
| def get_class_in_module(pretrained_model_name_or_path, class_name, module_path): |
There was a problem hiding this comment.
Could we do:
defget_class_in_module(class_name, module_path, pretrained_model_name_or_path=None):This will ensure the change is not backward breaking.
There was a problem hiding this comment.
Thanks for the feedback, I've made the proposed change
akasharidas
commented
Jun 4, 2025
To test this we need a repo that both has a dot in the name and has custom remote code. Currently I'm testing it on a private repo. @sayakpaul could you help by creating a new repo on |
akasharidas
commented
Jun 9, 2025
Added a test for it in |
sayakpaul
commented
Jun 10, 2025
@DN6 could you give this a look? |
HuggingFaceDocBuilderDev
commented
Jun 10, 2025
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. |
What does this PR do?
When the repo path for a model containing custom code contains
., the code fails to import it correctly because.is interpreted by the Python import machinery as a module separator. This issue was reported in Transformers (huggingface/transformers#28919) and was fixed in huggingface/transformers#29175. The same issue exists in Diffusers, so this PR brings over that fix with minor changes to account for how Diffusers names the cache directory.Before submitting
Who can review?
@yiyixuxu@sayakpaul@asomoza