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
8581d9bc
Unverified
Commit
8581d9bc
authored
Jan 27, 2024
by
gzguevara
Committed by
GitHub
Jan 27, 2024
Browse files
changed to posix unet (#6719)
changed to posix Co-authored-by:
Sayak Paul
<
spsayakpaul@gmail.com
>
parent
c1010662
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/diffusers/loaders/unet.py
src/diffusers/loaders/unet.py
+4
-2
No files found.
src/diffusers/loaders/unet.py
View file @
8581d9bc
...
@@ -16,6 +16,7 @@ import os
...
@@ -16,6 +16,7 @@ import os
from
collections
import
defaultdict
from
collections
import
defaultdict
from
contextlib
import
nullcontext
from
contextlib
import
nullcontext
from
functools
import
partial
from
functools
import
partial
from
pathlib
import
Path
from
typing
import
Callable
,
Dict
,
List
,
Optional
,
Union
from
typing
import
Callable
,
Dict
,
List
,
Optional
,
Union
import
safetensors
import
safetensors
...
@@ -503,8 +504,9 @@ class UNet2DConditionLoadersMixin:
...
@@ -503,8 +504,9 @@ class UNet2DConditionLoadersMixin:
weight_name
=
CUSTOM_DIFFUSION_WEIGHT_NAME
if
is_custom_diffusion
else
LORA_WEIGHT_NAME
weight_name
=
CUSTOM_DIFFUSION_WEIGHT_NAME
if
is_custom_diffusion
else
LORA_WEIGHT_NAME
# Save the model
# Save the model
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
fuse_lora
(
self
,
lora_scale
=
1.0
,
safe_fusing
=
False
,
adapter_names
=
None
):
def
fuse_lora
(
self
,
lora_scale
=
1.0
,
safe_fusing
=
False
,
adapter_names
=
None
):
self
.
lora_scale
=
lora_scale
self
.
lora_scale
=
lora_scale
...
...
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