// transfer some attributes from dataset to model args
for key in {"vocab_size", "max_ques_count"}:
config["model"][key] = getattr(dataset, key)
// ----------------------------------------------------------------------------
// setup the model and optimizer
After Change
// ----------------------------------------------------------------------------
// let the model know vocabulary size, to declare embedding layer
config["model"]["vocab_size"] = len(dataset.vocabulary)
encoder = Encoder(config["model"])
decoder = Decoder(config["model"])