def build_model_from_config(config, mode="infer"):
model_config = config["model"]
model_name = model_config["name"]
vocabs = {}
if "vocabs" in config:
for vocab_param_name, vocab_config in config["vocabs"].items():
After Change
model = Chainer(model_config["in"], model_config["out"], model_config.get("in_y"))
for component_config in model_config["pipe"]:
component = from_params(component_config, vocabs=[], mode=mode)
if "in" in component_config:
c_in = component_config["in"]
c_out = component_config["out"]