parser.add_argument_group("Evaluation related arguments")
parser.add_argument("--load-path", default="checkpoints/model.pth",
help="Path to load pretrained checkpoint from.")
parser.add_argument("--split", default="val", choices=["val", "test"],
help="Split to evaluate on")
parser.add_argument("--use-gt", action="store_true",
help="Whether to use ground truth for retrieving ranks")
parser.add_argument_group("Arguments independent of experiment reproducibility")
After Change
// ----------------------------------------------------------------------------
// let the model know vocabulary size, to declare embedding layer
config["model"]["vocab_size"] = len(dataset.vocabulary)
components = torch.load(args.load_path)
encoder = Encoder(config["model"])