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
429dace1
Unverified
Commit
429dace1
authored
Sep 17, 2022
by
Patrick von Platen
Committed by
GitHub
Sep 17, 2022
Browse files
[Configuration] Better logging (#545)
* [Config] improve logging * finish
parent
d7dcba4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
src/diffusers/configuration_utils.py
src/diffusers/configuration_utils.py
+11
-2
No files found.
src/diffusers/configuration_utils.py
View file @
429dace1
...
...
@@ -289,11 +289,20 @@ class ConfigMixin:
# use value from config dict
init_dict
[
key
]
=
config_dict
.
pop
(
key
)
unused_kwargs
=
config_dict
.
update
(
kwargs
)
config_dict
=
{
k
:
v
for
k
,
v
in
config_dict
.
items
()
if
not
k
.
startswith
(
"_"
)}
if
len
(
config_dict
)
>
0
:
logger
.
warning
(
f
"The config attributes
{
config_dict
}
were passed to
{
cls
.
__name__
}
, "
"but are not expected and will be ignored. Please verify your "
f
"
{
cls
.
config_name
}
configuration file."
)
unused_kwargs
=
{
**
config_dict
,
**
kwargs
}
passed_keys
=
set
(
init_dict
.
keys
())
if
len
(
expected_keys
-
passed_keys
)
>
0
:
logger
.
warning
(
logger
.
info
(
f
"
{
expected_keys
-
passed_keys
}
was not found in config. Values will be initialized to default values."
)
...
...
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