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
d603ccb6
Unverified
Commit
d603ccb6
authored
Feb 26, 2024
by
Dhruv Nair
Committed by
GitHub
Feb 26, 2024
Browse files
Small change to download in dance diffusion convert script (#7070)
* update * make style
parent
fd0f4695
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
scripts/convert_dance_diffusion_to_diffusers.py
scripts/convert_dance_diffusion_to_diffusers.py
+8
-2
No files found.
scripts/convert_dance_diffusion_to_diffusers.py
View file @
d603ccb6
...
...
@@ -4,6 +4,7 @@ import math
import
os
from
copy
import
deepcopy
import
requests
import
torch
from
audio_diffusion.models
import
DiffusionAttnUnet1D
from
diffusion
import
sampling
...
...
@@ -73,9 +74,14 @@ class DiffusionUncond(nn.Module):
def
download
(
model_name
):
url
=
MODELS_MAP
[
model_name
][
"url"
]
os
.
system
(
f
"w
get
{
url
}
./"
)
r
=
requests
.
get
(
url
,
stream
=
True
)
return
f
"./
{
model_name
}
.ckpt"
local_filename
=
f
"./
{
model_name
}
.ckpt"
with
open
(
local_filename
,
"wb"
)
as
fp
:
for
chunk
in
r
.
iter_content
(
chunk_size
=
8192
):
fp
.
write
(
chunk
)
return
local_filename
DOWN_NUM_TO_LAYER
=
{
...
...
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