聊聊ShareGPT格式的微调数据集

概述

ShareGPT格式的数据集中,一般是如下格式:

  1. [

  2. {

  3. "conversations": [

  4. {

  5. "from": "human",

  6. "value": "I saw a dress that I liked. It was originally priced at $200 but it's on sale for 20% off. Can you tell me how much it will cost after the discount?"

  7. },

  8. {

  9. "from": "function_call",

  10. "value": "{"name": "calculate_discount", "arguments": {"original_price": 200, "discount_percentage": 20}}"

  11. },

  12. {

  13. "from": "observation",

  14. "value": "{"discounted_price": 160}"

  15. },

  16. {

  17. "from": "gpt",

  18. "value": "The dress will cost you $160 after the 20% discount."

  19. }

  20. ],

  21. "system": "系统提示词(选填)",

  22. "tools": "[{"name": "calculate_discount", "description": "Calculate the discounted price", "parameters": {"type": "object", "properties": {"original_price": {"type": "number", "description": "The original price of the item"}, "discount_percentage": {"type": "number", "description": "The percentage of discount"}}, "required": ["original_price", "discount_percentage"]}}]"

  23. }

  24. ]

function_call表示函数调用,什么是函数调用?其作用是什么? 由于大模型的数据一般都是截止于某个时间点之前的数据,不具备实时性。比如,我要问今天的天气,正常来说,由于模型参数的局限性,是不会知道的。但基于函数调用的功能,就解决了这个问题。 所谓的 function_call,在某个程度来说,可以理解为API调用,这个API就是一个function,提供了某种功能。

observation表示观测结果,即 function_call的执行结果。

tools表示工具,即对 function_call的总结描述。

observation并不是新词汇,对于HMM模型如果有了解的话,在其模型算法的表述中,也有着observation的相关引用。

ShareGPT格式简单明了而且结构强大,不仅仅轻易的支持单轮对话、多轮对话;还引入了强大的函数调用,支持功能扩展。

扩展

function_call的设计引申出来,可以对应到业务开发中的规则引擎、脚本引擎等设计。譬如,支持在json参数的格式中,传入JS脚本参数,做一些强大的运算等。在原有的参数格式中,引入强大的函数调用支持。 参考:

如何在聊天模型中调用函数(Function Calling)–金融大模型知识库实战(十六)

大模型开发 – 一文搞懂 Function Calling(函数调用)


原文始发于微信公众号(阿郎小哥的随笔驿站):聊聊ShareGPT格式的微调数据集

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/251681.html

(0)
小半的头像小半

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!