Allow remote code repo names to contain "."#11652
Allow remote code repo names to contain "."#11652yiyixuxu merged 4 commits intohuggingface:mainfrom akasharidas:allow_dot_in_repo_name
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:
def get_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
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 |
|
Added a test for it in |
|
@DN6 could you give this a look? |
|
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