Unverified Commit 8f206a58 authored by YiYi Xu's avatar YiYi Xu Committed by GitHub
Browse files

fix a bug in `from_config` (#7192)



* fix

* fix

* update comment

---------
Co-authored-by: default avataryiyixuxu <yixu310@gmail,com>
parent 8da360aa
...@@ -259,6 +259,10 @@ class ConfigMixin: ...@@ -259,6 +259,10 @@ class ConfigMixin:
model = cls(**init_dict) model = cls(**init_dict)
# make sure to also save config parameters that might be used for compatible classes # make sure to also save config parameters that might be used for compatible classes
# update _class_name
if "_class_name" in hidden_dict:
hidden_dict["_class_name"] = cls.__name__
model.register_to_config(**hidden_dict) model.register_to_config(**hidden_dict)
# add hidden kwargs of compatible classes to unused_kwargs # add hidden kwargs of compatible classes to unused_kwargs
......
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