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
1c14ce95
Commit
1c14ce95
authored
Jul 15, 2022
by
Patrick von Platen
Browse files
fix local subfolder
parent
29628acb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
src/diffusers/configuration_utils.py
src/diffusers/configuration_utils.py
+4
-0
src/diffusers/modeling_utils.py
src/diffusers/modeling_utils.py
+4
-0
src/diffusers/schedulers/scheduling_pndm.py
src/diffusers/schedulers/scheduling_pndm.py
+3
-1
No files found.
src/diffusers/configuration_utils.py
View file @
1c14ce95
...
...
@@ -134,6 +134,10 @@ class ConfigMixin:
if
os
.
path
.
isfile
(
os
.
path
.
join
(
pretrained_model_name_or_path
,
cls
.
config_name
)):
# Load from a PyTorch checkpoint
config_file
=
os
.
path
.
join
(
pretrained_model_name_or_path
,
cls
.
config_name
)
elif
subfolder
is
not
None
and
os
.
path
.
isfile
(
os
.
path
.
join
(
pretrained_model_name_or_path
,
subfolder
,
cls
.
config_name
)
):
config_file
=
os
.
path
.
join
(
pretrained_model_name_or_path
,
subfolder
,
cls
.
config_name
)
else
:
raise
EnvironmentError
(
f
"Error no file named
{
cls
.
config_name
}
found in directory
{
pretrained_model_name_or_path
}
."
...
...
src/diffusers/modeling_utils.py
View file @
1c14ce95
...
...
@@ -348,6 +348,10 @@ class ModelMixin(torch.nn.Module):
if
os
.
path
.
isfile
(
os
.
path
.
join
(
pretrained_model_name_or_path
,
WEIGHTS_NAME
)):
# Load from a PyTorch checkpoint
model_file
=
os
.
path
.
join
(
pretrained_model_name_or_path
,
WEIGHTS_NAME
)
elif
subfolder
is
not
None
and
os
.
path
.
isfile
(
os
.
path
.
join
(
pretrained_model_name_or_path
,
subfolder
,
WEIGHTS_NAME
)
):
model_file
=
os
.
path
.
join
(
pretrained_model_name_or_path
,
subfolder
,
WEIGHTS_NAME
)
else
:
raise
EnvironmentError
(
f
"Error no file named
{
WEIGHTS_NAME
}
found in directory
{
pretrained_model_name_or_path
}
."
...
...
src/diffusers/schedulers/scheduling_pndm.py
View file @
1c14ce95
...
...
@@ -214,7 +214,9 @@ class PNDMScheduler(SchedulerMixin, ConfigMixin):
)
**
(
0.5
)
# full formula (9)
prev_sample
=
sample_coeff
*
sample
-
(
alpha_prod_t_prev
-
alpha_prod_t
)
*
model_output
/
model_output_denom_coeff
prev_sample
=
(
sample_coeff
*
sample
-
(
alpha_prod_t_prev
-
alpha_prod_t
)
*
model_output
/
model_output_denom_coeff
)
return
prev_sample
...
...
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