Skip to content

Commit

Permalink
馃悰 Fix multi-label model load issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrikerMan committed Nov 18, 2020
1 parent 7f87bdc commit 4ee0f3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kashgari/utils/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ def load_data_object(data: Dict,
"""
if custom_objects is None:
custom_objects = {}

if data['__class_name__'] in custom_objects:
obj: Any = custom_objects[data['__class_name__']](**kwargs)
obj: Any = custom_objects[data['__class_name__']](**data['config'], **kwargs)
else:
module_name = f"{data['__module__']}.{data['__class_name__']}"
obj: Any = pydoc.locate(module_name)(**data['config'], **kwargs) # type: ignore
Expand Down

0 comments on commit 4ee0f3c

Please sign in to comment.