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

关于目前插件功能的使用以及后续的开发的一些疑问 #73

Closed
xerrors opened this issue Apr 23, 2023 · 4 comments
Closed

Comments

@xerrors
Copy link

xerrors commented Apr 23, 2023

请教一个问题,以我目前对 plugin 的理解,是需要通过特定的插件训练数据来让模型知道应该调用那些工具,然后根据用户指令输出需要的工具的占位符 如 WebSearch(XXX),然后再调用相应的接口完成这部分结果,将结果替换掉 WebSearch(XXX) -> YYYY,最后再跟之前的结果一起再次喂给模型。目前所了解的似乎是这样的,类似于 ToolFormer 的思路。

作者:孙天祥
链接:https://www.zhihu.com/question/596908242/answer/2994534005
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

为了帮助MOSS决定调用什么API、传入什么参数,以及帮助MOSS通过类似思维链的方式提升推理能力,我们还给MOSS增加了Inner Thoughts作为输出,即在MOSS决定调用API以及回复之前首先输出其“内心想法”,具体格式为

<|Human|>: ...<eoh>
<|Inner Thoughts|>: ...<eot>
<|Commands|>: ...<eoc>
<|Results|>: ...<eor>
<|MOSS|>: ...<eom>

因此,当使用plugin的时候,我们需要调用两次模型推理:第一次给<|Human|>输入预测<|Inner Thoughts|>和<|Commands|>,解析出API调用并得到相应结果后放入<|Results|>中并与前文拼接,然后第二次调用模型推理得到<|MOSS|>回复。大家可以通过我们web界面中MOSS回复消息框右下角的小灯泡查看MOSS的“内心想法”。

所以就是说,如果我想让模型支持这 4 个插件之外的插件,比如 CodeRuner,是需要构建相关的数据集并且重新训练模型才可以是吗?

https://github.com/OpenLMLab/MOSS/blob/953f76ca7d1a6898e717b8ec13bfc0d28bac6e2f/SFT_data/conversations/conversation_with_plugins/web_search/search_plugin_conversation_10.json#L1-L29

@guozhiyao
Copy link

借着你的问题,还想请问下,如果用户输入的一句话里想要同时调用多个插件,是不是不允许?比如用户输入“通过浏览器搜索蒙娜丽莎的图片,并转化为山水画风格”。这里就涉及到浏览器搜索和绘图两个插件,目前是不是不支持呢?

@fengtianyu88
Copy link

项目中自带的gradio不能开启插件?

@xerrors
Copy link
Author

xerrors commented Apr 23, 2023

项目中自带的gradio不能开启插件?

插件的运行是依赖于后端的服务的,见 #51 (comment)

@txsun1997
Copy link
Contributor

@xerrors 插件版MOSS的使用说明已经更新到README

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

4 participants