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

预测问题

Open terminator123 opened this issue 2 years ago • 3 comments

直接用CDial-GPT2_LCCC-base 预测 预测那部分代码有修改,不然跑不通

output = model(input_ids, token_type_ids=token_type_ids) logits = output.logits logits = logits[0, -1, :] / args.temperature

不管输入是什么,结果都如下

[12997, 7635, 12997, 7635, 12997, 12997, 12997, 12997, 7635, 12997, 7635, 12997, 7635, 12997, 7635, 12997, 7635, 12997, 7635, 12997, 12997, 12997, 7635, 7635, 12997, 7635, 12997, 7635, 7635, 12997] 囌 僦 囌 僦 囌 囌 囌 囌 僦 囌 僦 囌 僦 囌 僦 囌 僦 囌 僦 囌 囌 囌 僦 僦 囌 僦 囌 僦 僦 囌

terminator123 avatar Jul 27 '22 02:07 terminator123

一样的问题,同问~

xuexidi avatar Sep 01 '22 02:09 xuexidi

注释掉这一句:logits, *_ = model(input_ids, token_type_ids=token_type_ids) 然后改成:
output = model(input_ids, token_type_ids=token_type_ids) logits = output.logits logits = logits[0, -1, :] / args.temperature logits = top_filtering(logits, top_k=args.top_k, top_p=args.top_p) probs = F.softmax(logits, dim=-1) 出来就是正常的对话了

wasssily avatar Sep 26 '22 07:09 wasssily