InternLM / Agent-FLAN

[ACL2024 Findings] Agent-FLAN: Designing Data and Methods of Effective Agent Tuning for Large Language Models
https://internlm.github.io/Agent-FLAN/
Apache License 2.0
316 stars 9 forks source link

模型推理代码 #9

Open xinyiqin opened 5 months ago

xinyiqin commented 5 months ago

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

zehuichen123 commented 5 months ago

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

xinyiqin commented 5 months ago

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

xinyiqin commented 5 months ago

哈喽~能麻烦解答一下吗

zehuichen123 commented 5 months ago

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