import parlai.scripts.eval_model as ems
parser = ems.setup_args()
parser.set_params(**opt)
parser.set_params(log_every_n_secs=10)
popt = parser.parse_args([], print_args=False)
if popt.get("model_file") and not popt.get("dict_file"):
popt["dict_file"] = popt["model_file"] + ".dict"
After Change
opt["datatype"] = "valid" if valid_datatype is None else valid_datatype
valid = None if skip_valid else ems.EvalModel.main(**opt)
opt["datatype"] = "test"
test = None if skip_test else ems.EvalModel.main(**opt)
return valid, test