"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "11d18f3217a9d986c9cca03144ff75ac5c87e777"
Unverified Commit 429dace1 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

[Configuration] Better logging (#545)

* [Config] improve logging

* finish
parent d7dcba4a
...@@ -289,11 +289,20 @@ class ConfigMixin: ...@@ -289,11 +289,20 @@ class ConfigMixin:
# use value from config dict # use value from config dict
init_dict[key] = config_dict.pop(key) 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()) passed_keys = set(init_dict.keys())
if len(expected_keys - passed_keys) > 0: 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." f"{expected_keys - passed_keys} was not found in config. Values will be initialized to default values."
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment