Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
dc07fc29
Unverified
Commit
dc07fc29
authored
Aug 22, 2024
by
YiYi Xu
Committed by
GitHub
Aug 22, 2024
Browse files
fix _identify_model_variants (#9247)
merge now, will add/fix test next
parent
805bf33f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/diffusers/pipelines/pipeline_loading_utils.py
src/diffusers/pipelines/pipeline_loading_utils.py
+4
-4
No files found.
src/diffusers/pipelines/pipeline_loading_utils.py
View file @
dc07fc29
...
@@ -752,12 +752,12 @@ def _fetch_class_library_tuple(module):
...
@@ -752,12 +752,12 @@ def _fetch_class_library_tuple(module):
def
_identify_model_variants
(
folder
:
str
,
variant
:
str
,
config
:
dict
)
->
dict
:
def
_identify_model_variants
(
folder
:
str
,
variant
:
str
,
config
:
dict
)
->
dict
:
model_variants
=
{}
model_variants
=
{}
if
variant
is
not
None
:
if
variant
is
not
None
:
for
folder
in
os
.
listdir
(
folder
):
for
sub_
folder
in
os
.
listdir
(
folder
):
folder_path
=
os
.
path
.
join
(
folder
,
folder
)
folder_path
=
os
.
path
.
join
(
folder
,
sub_
folder
)
is_folder
=
os
.
path
.
isdir
(
folder_path
)
and
folder
in
config
is_folder
=
os
.
path
.
isdir
(
folder_path
)
and
sub_
folder
in
config
variant_exists
=
is_folder
and
any
(
p
.
split
(
"."
)[
1
].
startswith
(
variant
)
for
p
in
os
.
listdir
(
folder_path
))
variant_exists
=
is_folder
and
any
(
p
.
split
(
"."
)[
1
].
startswith
(
variant
)
for
p
in
os
.
listdir
(
folder_path
))
if
variant_exists
:
if
variant_exists
:
model_variants
[
folder
]
=
variant
model_variants
[
sub_
folder
]
=
variant
return
model_variants
return
model_variants
...
...
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