Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
7c54a7b3
Unverified
Commit
7c54a7b3
authored
Sep 24, 2025
by
Dhruv Nair
Committed by
GitHub
Sep 24, 2025
Browse files
Fix Custom Code loading (#12378)
* update * update * update
parent
09e777a3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/diffusers/models/auto_model.py
src/diffusers/models/auto_model.py
+1
-1
src/diffusers/modular_pipelines/modular_pipeline.py
src/diffusers/modular_pipelines/modular_pipeline.py
+1
-1
No files found.
src/diffusers/models/auto_model.py
View file @
7c54a7b3
...
@@ -194,7 +194,7 @@ class AutoModel(ConfigMixin):
...
@@ -194,7 +194,7 @@ class AutoModel(ConfigMixin):
has_remote_code
=
"auto_map"
in
config
and
cls
.
__name__
in
config
[
"auto_map"
]
has_remote_code
=
"auto_map"
in
config
and
cls
.
__name__
in
config
[
"auto_map"
]
trust_remote_code
=
resolve_trust_remote_code
(
trust_remote_code
,
pretrained_model_or_path
,
has_remote_code
)
trust_remote_code
=
resolve_trust_remote_code
(
trust_remote_code
,
pretrained_model_or_path
,
has_remote_code
)
if
not
(
has_remote_code
and
trust_remote_code
)
:
if
not
has_remote_code
and
trust_remote_code
:
raise
ValueError
(
raise
ValueError
(
"Selected model repository does not happear to have any custom code or does not have a valid `config.json` file."
"Selected model repository does not happear to have any custom code or does not have a valid `config.json` file."
)
)
...
...
src/diffusers/modular_pipelines/modular_pipeline.py
View file @
7c54a7b3
...
@@ -323,7 +323,7 @@ class ModularPipelineBlocks(ConfigMixin, PushToHubMixin):
...
@@ -323,7 +323,7 @@ class ModularPipelineBlocks(ConfigMixin, PushToHubMixin):
trust_remote_code
=
resolve_trust_remote_code
(
trust_remote_code
=
resolve_trust_remote_code
(
trust_remote_code
,
pretrained_model_name_or_path
,
has_remote_code
trust_remote_code
,
pretrained_model_name_or_path
,
has_remote_code
)
)
if
not
(
has_remote_code
and
trust_remote_code
)
:
if
not
has_remote_code
and
trust_remote_code
:
raise
ValueError
(
raise
ValueError
(
"Selected model repository does not happear to have any custom code or does not have a valid `config.json` file."
"Selected model repository does not happear to have any custom code or does not have a valid `config.json` file."
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment