pipeline如何设置temperature、top_p参数?
我看过代码,在调用pipe(inputs)时,将参数写入inputs即可。目前支持这些参数:do_sample\temperature\max_length\num_beams\top_p\logits_processor
举个例子,如果不用sample,想用greedy search:inputs = {'text':'请写一首五言绝句。', 'history': [], 'do_sample':False}print(pipe(inputs))
这样生成的内容就每次一样了。
建议模型提供方、平台方完善模型文档说明,尤其要说明设置参数这样的基本操作,提高ModelScope平台的易用性。
赞1
踩0