Felixgithub2017 / MMCU

MEASURING MASSIVE MULTITASK CHINESE UNDERSTANDING
87 stars 12 forks source link

model.chat()具有随机性 #6

Open CSHaitao opened 1 year ago

CSHaitao commented 1 year ago

以chatglm为例,model.chat()每次可能生成结果不一样,建议改成贪婪解码可以生成稳定的答案 generation_kwargs = { "min_length": 0, "max_new_tokens": 512, 'do_sample':False, 'top_p':0.9, 'temperature':0.8, }

另外,model或许应该model.eval()?