CDial-GPT
CDial-GPT copied to clipboard
预测问题
直接用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] 囌 僦 囌 僦 囌 囌 囌 囌 僦 囌 僦 囌 僦 囌 僦 囌 僦 囌 僦 囌 囌 囌 僦 僦 囌 僦 囌 僦 僦 囌
一样的问题,同问~
注释掉这一句: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)
出来就是正常的对话了