聊聊ShareGPT格式的微调数据集

转载请注明住处:https://www.cnblogs.com/zhiyong-ITNote

概述

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

json 复制代码
[
  {
    "conversations": [
      {
        "from": "human",
        "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?"
      },
      {
        "from": "function_call",
        "value": "{\"name\": \"calculate_discount\", \"arguments\": {\"original_price\": 200, \"discount_percentage\": 20}}"
      },
      {
        "from": "observation",
        "value": "{\"discounted_price\": 160}"
      },
      {
        "from": "gpt",
        "value": "The dress will cost you $160 after the 20% discount."
      }
    ],
    "system": "系统提示词(选填)",
    "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\"]}}]"
  }
]

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(函数调用)

转载请注明住处:https://www.cnblogs.com/zhiyong-ITNote

首发于个人公众号

相关推荐
AI大模型-小雄13 天前
Codex 测试总跑不完怎么办?补 Credits 还是升级 Pro
人工智能·chatgpt·提示词·codex·ai办公·chatgpt pro·credits
AI大模型-小雄20 天前
用 ChatGPT 整理工作资料,正确的提问顺序是什么?附完整操作模板
人工智能·chatgpt·提示词·效率工具·codex·办公技巧·ai办公
杠杠的blog20 天前
企业级提示词管理
python·agent·提示词·生产级实践
xcLeigh22 天前
提示词三大要素:角色、任务与约束的黄金三角
人工智能·ai·提示词·任务·约束·角色
xcLeigh1 个月前
提示词基础:什么是Prompt以及它为何如此重要
人工智能·ai·大模型·prompt·ai写作·提示词
AI大佬的小弟1 个月前
提示词工程(2)---提示词工程核心概念与五大设计原则详解
提示词·提示词工程·大模型基础·如何写好提示词·提示词的五大原则
lichong9512 个月前
让AI自己用电脑!Cua:后台操作鼠标键盘,Mac/Windows/Linux全支持
人工智能·macos·ai·计算机外设·agent·提示词
-星空下无敌2 个月前
Skills详解(2万字详细教程),Skills是什么,如何安装并使用Skills
人工智能·ai·提示词·codex·mcp·skills·agent skills
城事漫游Molly2 个月前
如何用 ChatGPT 辅助写文献综述,而不是编造文献?
人工智能·chatgpt·提示词·ai for science·文献综述
Litluecat2 个月前
配合多角色提示语3,学习AI漫剧(刚开始学)
人工智能·学习·ai·提示词·短剧·漫剧