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
0e5a99bb
Commit
0e5a99bb
authored
Jul 19, 2022
by
anton-l
Browse files
Quick hacks for push_to_hub from notebooks - follow-up
parent
e3c982ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/diffusers/hub_utils.py
src/diffusers/hub_utils.py
+3
-3
No files found.
src/diffusers/hub_utils.py
View file @
0e5a99bb
...
...
@@ -50,7 +50,7 @@ def init_git_repo(args, at_init: bool = False):
Whether this function is called before any training or not. If `self.args.overwrite_output_dir` is `True`
and `at_init` is `True`, the path to the repo (which is `self.args.output_dir`) might be wiped out.
"""
if
not
hasattr
(
args
,
"local_rank"
)
or
args
.
local_rank
not
in
[
-
1
,
0
]:
if
hasattr
(
args
,
"local_rank"
)
and
args
.
local_rank
not
in
[
-
1
,
0
]:
return
hub_token
=
args
.
hub_token
if
hasattr
(
args
,
"hub_token"
)
else
None
use_auth_token
=
True
if
hub_token
is
None
else
hub_token
...
...
@@ -112,7 +112,7 @@ def push_to_hub(
commit and an object to track the progress of the commit if `blocking=True`
"""
if
args
.
hub_model_id
is
None
:
if
not
hasattr
(
args
,
"hub_model_id"
)
or
args
.
hub_model_id
is
None
:
model_name
=
Path
(
args
.
output_dir
).
name
else
:
model_name
=
args
.
hub_model_id
.
split
(
"/"
)[
-
1
]
...
...
@@ -123,7 +123,7 @@ def push_to_hub(
pipeline
.
save_pretrained
(
output_dir
)
# Only push from one node.
if
not
hasattr
(
args
,
"local_rank"
)
or
args
.
local_rank
not
in
[
-
1
,
0
]:
if
hasattr
(
args
,
"local_rank"
)
and
args
.
local_rank
not
in
[
-
1
,
0
]:
return
# Cancel any async push in progress if blocking=True. The commits will all be pushed together.
...
...
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