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
OpenDAS
ColossalAI
Commits
d3379f0b
Commit
d3379f0b
authored
Jun 06, 2023
by
Maruyama_Aya
Browse files
fixed model saving bugs
parent
b29e1f07
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
examples/images/dreambooth/train_dreambooth_colossalai.py
examples/images/dreambooth/train_dreambooth_colossalai.py
+2
-2
examples/images/dreambooth/train_dreambooth_colossalai_lora.py
...les/images/dreambooth/train_dreambooth_colossalai_lora.py
+2
-2
No files found.
examples/images/dreambooth/train_dreambooth_colossalai.py
View file @
d3379f0b
...
...
@@ -667,9 +667,9 @@ def main(args):
if
global_step
%
args
.
save_steps
==
0
:
torch
.
cuda
.
synchronize
()
if
local_rank
==
0
:
save_path
=
os
.
path
.
join
(
args
.
output_dir
,
f
"checkpoint-
{
global_step
}
"
)
booster
.
save_model
(
unet
,
os
.
path
.
join
(
save_path
,
"diffusion_pytorch_model.bin"
))
if
local_rank
==
0
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
save_path
,
"config.json"
)):
shutil
.
copy
(
os
.
path
.
join
(
args
.
pretrained_model_name_or_path
,
"unet/config.json"
),
save_path
)
logger
.
info
(
f
"Saving model checkpoint to
{
save_path
}
"
,
ranks
=
[
0
])
...
...
examples/images/dreambooth/train_dreambooth_colossalai_lora.py
View file @
d3379f0b
...
...
@@ -693,9 +693,9 @@ def main(args):
if
global_step
%
args
.
save_steps
==
0
:
torch
.
cuda
.
synchronize
()
if
local_rank
==
0
:
save_path
=
os
.
path
.
join
(
args
.
output_dir
,
f
"checkpoint-
{
global_step
}
"
)
booster
.
save_model
(
unet
,
os
.
path
.
join
(
save_path
,
"diffusion_pytorch_model.bin"
))
if
local_rank
==
0
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
save_path
,
"config.json"
)):
shutil
.
copy
(
os
.
path
.
join
(
args
.
pretrained_model_name_or_path
,
"unet/config.json"
),
save_path
)
logger
.
info
(
f
"Saving model checkpoint to
{
save_path
}
"
,
ranks
=
[
0
])
...
...
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