INNER CODE UNIT · Python
mkdir
yixinL7/BRIO · main.py:92
def mkdir(path):
if not os.path.exists(path):
os.mkdir(path)
print(model_name)
root_dir = "./result/%s"%model_name
mkdir(root_dir)
rouge_scorer = RougeScorer(['rouge1', 'rouge2', 'rougeLsum'], use_stemmer=True)
if args.do_reranking:
# evaluate the model as a scorer
mkdir("./result/%s/reference_ranking"%model_name)
mkdir("./result/%s/candidate_ranking"%model_name)
rouge1, rouge2, rougeLsum = 0, 0, 0
cnt = 0
model.scoring_mode()
with torch.no_grad():
for batch in tqdm(dataloader, total=len(test_set) // batch_size):