Agent-FLAN icon indicating copy to clipboard operation
Agent-FLAN copied to clipboard

模型推理代码

Open xinyiqin opened this issue 1 year ago • 4 comments

您好,想求一份Agent-flan的推理代码! p.s 貌似模型中没有定义template中的special tokens比如这种,ി\n,不清楚推理中具体是怎么处理的。 以及template中好像没有定义Function的。

xinyiqin avatar Apr 03 '24 02:04 xinyiqin

可以用lagent的推理框架然后走huggingface那个class,把readme里面的meta template传进那个类就好了 我们没有专门定义function的role,function的返回都当作user处理

zehuichen123 avatar Apr 03 '24 03:04 zehuichen123

你好,感谢回答。想知道下推理的system prompt构造大概是什么样以及训练时的function_call格式,因为直接推理的话返回的function_call格式比较五花八门的,不是很方便提取。

xinyiqin avatar Apr 03 '24 20:04 xinyiqin

哈喽~能麻烦解答一下吗

xinyiqin avatar Apr 07 '24 03:04 xinyiqin

训练的时候我们用了多套模版,所以在推理的时候用react那种Thought: Action: ActionInput:就可以,当然也可以用JSON format的system prompt, {thought:"", action: "", action_input:""}

zehuichen123 avatar Apr 08 '24 02:04 zehuichen123