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
99086091
Unverified
Commit
99086091
authored
Jan 16, 2024
by
Charchit Sharma
Committed by
GitHub
Jan 16, 2024
Browse files
change to posix for better Windows support for lora loaders (#6590)
* posix lora * changes and style fix
parent
23eed397
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/diffusers/loaders/lora.py
src/diffusers/loaders/lora.py
+4
-2
No files found.
src/diffusers/loaders/lora.py
View file @
99086091
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
import
inspect
import
inspect
import
os
import
os
from
contextlib
import
nullcontext
from
contextlib
import
nullcontext
from
pathlib
import
Path
from
typing
import
Callable
,
Dict
,
List
,
Optional
,
Union
from
typing
import
Callable
,
Dict
,
List
,
Optional
,
Union
import
safetensors
import
safetensors
...
@@ -960,8 +961,9 @@ class LoraLoaderMixin:
...
@@ -960,8 +961,9 @@ class LoraLoaderMixin:
else
:
else
:
weight_name
=
LORA_WEIGHT_NAME
weight_name
=
LORA_WEIGHT_NAME
save_function
(
state_dict
,
os
.
path
.
join
(
save_directory
,
weight_name
))
save_path
=
Path
(
save_directory
,
weight_name
).
as_posix
()
logger
.
info
(
f
"Model weights saved in
{
os
.
path
.
join
(
save_directory
,
weight_name
)
}
"
)
save_function
(
state_dict
,
save_path
)
logger
.
info
(
f
"Model weights saved in
{
save_path
}
"
)
def
unload_lora_weights
(
self
):
def
unload_lora_weights
(
self
):
"""
"""
...
...
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