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
OpenDAS
diffusers
Commits
d384265d
Unverified
Commit
d384265d
authored
Nov 08, 2023
by
Philipp Hasper
Committed by
GitHub
Nov 08, 2023
Browse files
Fixed is_safetensors_compatible() handling of windows path separators (#5650)
Closes #4665
parent
11c12566
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
src/diffusers/pipelines/pipeline_utils.py
src/diffusers/pipelines/pipeline_utils.py
+4
-5
No files found.
src/diffusers/pipelines/pipeline_utils.py
View file @
d384265d
...
...
@@ -158,9 +158,9 @@ def is_safetensors_compatible(filenames, variant=None, passed_components=None) -
continue
if
extension
==
".bin"
:
pt_filenames
.
append
(
filename
)
pt_filenames
.
append
(
os
.
path
.
normpath
(
filename
)
)
elif
extension
==
".safetensors"
:
sf_filenames
.
add
(
filename
)
sf_filenames
.
add
(
os
.
path
.
normpath
(
filename
)
)
for
filename
in
pt_filenames
:
# filename = 'foo/bar/baz.bam' -> path = 'foo/bar', filename = 'baz', extention = '.bam'
...
...
@@ -172,9 +172,8 @@ def is_safetensors_compatible(filenames, variant=None, passed_components=None) -
else
:
filename
=
filename
expected_sf_filename
=
os
.
path
.
join
(
path
,
filename
)
expected_sf_filename
=
os
.
path
.
normpath
(
os
.
path
.
join
(
path
,
filename
)
)
expected_sf_filename
=
f
"
{
expected_sf_filename
}
.safetensors"
if
expected_sf_filename
not
in
sf_filenames
:
logger
.
warning
(
f
"
{
expected_sf_filename
}
not found"
)
return
False
...
...
@@ -1774,7 +1773,7 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin):
)
):
raise
EnvironmentError
(
f
"Could not f
ou
nd the necessary `safetensors` weights in
{
model_filenames
}
(variant=
{
variant
}
)"
f
"Could not f
i
nd the necessary `safetensors` weights in
{
model_filenames
}
(variant=
{
variant
}
)"
)
if
from_flax
:
ignore_patterns
=
[
"*.bin"
,
"*.safetensors"
,
"*.onnx"
,
"*.pb"
]
...
...
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