for key, class_name in embeddings_dict.items():
md = read_json("{}-{}-md.json".format(basename, key))
embed_args = dict({"vsz": md["vsz"], "dsz": md["dsz"]})
Constructor = eval(class_name)
embeddings[key] = Constructor(key, **embed_args)
model = cls.create(embeddings, **_state)
model._state = _state
After Change
with _state["sess"].graph.as_default():
embeddings = reload_embeddings(embeddings_info, basename)
for k in embeddings_info:
if k in kwargs:
_state[k] = kwargs[k]
_state["model_type"] = kwargs.get("model_type", "default")
model = cls.create(embeddings, **_state)
model._state = _state