Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
diffusers
Commits
56e772ab
Unverified
Commit
56e772ab
authored
Jul 20, 2024
by
Lucain
Committed by
GitHub
Jul 20, 2024
Browse files
Use model_info.id instead of model_info.modelId (#8912)
Mention model_info.id instead of model_info.modelId
parent
fe794894
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
scripts/generate_logits.py
scripts/generate_logits.py
+6
-6
No files found.
scripts/generate_logits.py
View file @
56e772ab
...
@@ -103,12 +103,12 @@ results["google_ddpm_ema_cat_256"] = torch.tensor([
...
@@ -103,12 +103,12 @@ results["google_ddpm_ema_cat_256"] = torch.tensor([
models
=
api
.
list_models
(
filter
=
"diffusers"
)
models
=
api
.
list_models
(
filter
=
"diffusers"
)
for
mod
in
models
:
for
mod
in
models
:
if
"google"
in
mod
.
author
or
mod
.
modelI
d
==
"CompVis/ldm-celebahq-256"
:
if
"google"
in
mod
.
author
or
mod
.
i
d
==
"CompVis/ldm-celebahq-256"
:
local_checkpoint
=
"/home/patrick/google_checkpoints/"
+
mod
.
modelI
d
.
split
(
"/"
)[
-
1
]
local_checkpoint
=
"/home/patrick/google_checkpoints/"
+
mod
.
i
d
.
split
(
"/"
)[
-
1
]
print
(
f
"Started running
{
mod
.
modelI
d
}
!!!"
)
print
(
f
"Started running
{
mod
.
i
d
}
!!!"
)
if
mod
.
modelI
d
.
startswith
(
"CompVis"
):
if
mod
.
i
d
.
startswith
(
"CompVis"
):
model
=
UNet2DModel
.
from_pretrained
(
local_checkpoint
,
subfolder
=
"unet"
)
model
=
UNet2DModel
.
from_pretrained
(
local_checkpoint
,
subfolder
=
"unet"
)
else
:
else
:
model
=
UNet2DModel
.
from_pretrained
(
local_checkpoint
)
model
=
UNet2DModel
.
from_pretrained
(
local_checkpoint
)
...
@@ -122,6 +122,6 @@ for mod in models:
...
@@ -122,6 +122,6 @@ for mod in models:
logits
=
model
(
noise
,
time_step
).
sample
logits
=
model
(
noise
,
time_step
).
sample
assert
torch
.
allclose
(
assert
torch
.
allclose
(
logits
[
0
,
0
,
0
,
:
30
],
results
[
"_"
.
join
(
"_"
.
join
(
mod
.
modelI
d
.
split
(
"/"
)).
split
(
"-"
))],
atol
=
1e-3
logits
[
0
,
0
,
0
,
:
30
],
results
[
"_"
.
join
(
"_"
.
join
(
mod
.
i
d
.
split
(
"/"
)).
split
(
"-"
))],
atol
=
1e-3
)
)
print
(
f
"
{
mod
.
modelI
d
}
has passed successfully!!!"
)
print
(
f
"
{
mod
.
i
d
}
has passed successfully!!!"
)
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