INNER CODE UNIT · Python
min_length
yixinL7/BRIO · main.py:156
min_length=args.gen_min_len + 1, # +1 from original because we start at step=1
no_repeat_ngram_size=3,
num_beams=args.num_beams,
length_penalty=args.length_penalty,
early_stopping=True,
)
dec = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in summaries]
for hypothesis in dec:
hypothesis = hypothesis.replace("\n", " ")
fout.write(hypothesis + '\n')
fout.flush()
slines = []
sline = sline.strip()
if len(sline) == 0:
sline = " "
slines.append(sline)
count += 1
if slines != []: