Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

模型推理代码 #9

Open
xinyiqin opened this issue Apr 3, 2024 · 4 comments
Open

模型推理代码 #9

xinyiqin opened this issue Apr 3, 2024 · 4 comments

Comments

@xinyiqin
Copy link

xinyiqin commented Apr 3, 2024

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

@zehuichen123
Copy link
Collaborator

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

@xinyiqin
Copy link
Author

xinyiqin commented Apr 3, 2024

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

@xinyiqin
Copy link
Author

xinyiqin commented Apr 7, 2024

哈喽~能麻烦解答一下吗

@zehuichen123
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants