CDial-GPT icon indicating copy to clipboard operation
CDial-GPT copied to clipboard

lm_loss类型是str,无法计算loss

Open ziqing0701 opened this issue 1 year ago • 2 comments

您好,我在运行train()时报错 TypeError: unsupported operand type(s) for /: 'str' and 'int' (lm_loss), *_ = model(input_ids, labels=lm_labels, token_type_ids=token_type_ids) loss = lm_loss / args.gradient_accumulation_steps

debug发现lm_loss 是str类型,请问是哪里出错了。 用的预训练thu-coai/CDial-GPT_LCCC-base模型,"--data_path"是"data/STC.json"

谢谢!

ziqing0701 avatar Mar 06 '23 08:03 ziqing0701