当前位置: 首页 > news >正文

区域城市分站网站怎么做谷歌google官方下载

区域城市分站网站怎么做,谷歌google官方下载,电子商务网站建设第一章课后,做外卖有哪些网站有哪些默认 Ollama 中的 Qwen2 模型不支持 Function Calling,使用默认 Qwen2,Ollama 会报错。本文将根据官方模板对 ChatTemplate 进行改进,使得Qwen2 支持 Tools,支持函数调用。 Ollama 会检查对话模板中是否存在 Tools,如…

默认 Ollama 中的 Qwen2 模型不支持 Function Calling,使用默认 Qwen2,Ollama 会报错。本文将根据官方模板对 ChatTemplate 进行改进,使得Qwen2 支持 Tools,支持函数调用。
在这里插入图片描述
Ollama 会检查对话模板中是否存在 Tools,如果不存在就会报错,下面的代码是 Ollama 解析模板的代码。
在这里插入图片描述
Ollama 3.1 是支持 Tools 的,可以看到模板中定义了 Tools。
在这里插入图片描述
修改 Qwen2 配置并创建新的模型,首先我们定义一个 Ollama 模型文件,创建文件 qwen_tools。

FROM qwen2:7b# set the temperature to 0.7 [higher is more creative, lower is more coherent]
PARAMETER temperature 0.7
PARAMETER top_p 0.8
PARAMETER repeat_penalty 1.05
TEMPLATE """{{ if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{ .System }}
{{- if .Tools }}# ToolsYou are provided with function signatures within <tools></tools> XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools:
<tools>{{- range .Tools }}{{ .Function }}{{- end }}</tools>For each function call, return a JSON object with function name and arguments within <tool_call></tool_call> XML tags as follows:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>{{- end }}<|im_end|>{{- end }}
{{- range .Messages }}
{{- if eq .Role "user" }}
<|im_start|>{{ .Role }}
{{ .Content }}<|im_end|>
{{- else if eq .Role "assistant" }}
<|im_start|>{{ .Role }}
{{- if .Content }}
{{ .Content }}
{{- end }}
{{- if .ToolCalls }}
<tool_call>
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{ end }}</tool_call>
{{- end }}<|im_end|>
{{- else if eq .Role "tool" }}
<|im_start|>user
<tool_response>
{{ .Content }}
</tool_response><|im_end|>
{{- end }}
{{- end }}
<|im_start|>assistant
{{ else }}{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
{{ end }}
"""

构建模型

ollama create qwen2tools --file ./qwen_tools 

测试模型

在这里插入图片描述

总结

现在的模型都是支持 Tools,在 Ollama 中使用我们需要对 Template 配置,配置好 Tools 后,就可以通过 Ollama 直接进行函数调用了。


文章转载自:
http://mosleyite.Lgnz.cn
http://refragable.Lgnz.cn
http://disuse.Lgnz.cn
http://submicrogram.Lgnz.cn
http://ittf.Lgnz.cn
http://clouding.Lgnz.cn
http://intermixture.Lgnz.cn
http://inflationary.Lgnz.cn
http://theologize.Lgnz.cn
http://thereby.Lgnz.cn
http://reest.Lgnz.cn
http://stopwatch.Lgnz.cn
http://australopithecus.Lgnz.cn
http://quirkily.Lgnz.cn
http://imaginary.Lgnz.cn
http://conspectus.Lgnz.cn
http://enthusiastic.Lgnz.cn
http://quadrature.Lgnz.cn
http://cathepsin.Lgnz.cn
http://fragmentized.Lgnz.cn
http://outlie.Lgnz.cn
http://organo.Lgnz.cn
http://orchestic.Lgnz.cn
http://ventriculi.Lgnz.cn
http://seedless.Lgnz.cn
http://mechlin.Lgnz.cn
http://sniper.Lgnz.cn
http://trivet.Lgnz.cn
http://inspectoral.Lgnz.cn
http://karaite.Lgnz.cn
http://growthman.Lgnz.cn
http://counterthrust.Lgnz.cn
http://emolument.Lgnz.cn
http://professionless.Lgnz.cn
http://neuroleptic.Lgnz.cn
http://thieves.Lgnz.cn
http://nomocracy.Lgnz.cn
http://ciggy.Lgnz.cn
http://dekko.Lgnz.cn
http://indictment.Lgnz.cn
http://alemanni.Lgnz.cn
http://calcification.Lgnz.cn
http://forepale.Lgnz.cn
http://unworthily.Lgnz.cn
http://zoning.Lgnz.cn
http://motuan.Lgnz.cn
http://subagency.Lgnz.cn
http://slanderously.Lgnz.cn
http://psro.Lgnz.cn
http://incubus.Lgnz.cn
http://dml.Lgnz.cn
http://startup.Lgnz.cn
http://doublespeak.Lgnz.cn
http://metre.Lgnz.cn
http://impassable.Lgnz.cn
http://lancet.Lgnz.cn
http://defrost.Lgnz.cn
http://discoverable.Lgnz.cn
http://slapping.Lgnz.cn
http://differentiae.Lgnz.cn
http://inobtrusive.Lgnz.cn
http://memomotion.Lgnz.cn
http://stooge.Lgnz.cn
http://psychometrical.Lgnz.cn
http://tectogenesis.Lgnz.cn
http://cacotrophia.Lgnz.cn
http://plenitudinous.Lgnz.cn
http://subpena.Lgnz.cn
http://indecorousness.Lgnz.cn
http://ahimsa.Lgnz.cn
http://kakistocracy.Lgnz.cn
http://dolichocephaly.Lgnz.cn
http://labefaction.Lgnz.cn
http://dicynodont.Lgnz.cn
http://sociological.Lgnz.cn
http://talari.Lgnz.cn
http://serail.Lgnz.cn
http://safari.Lgnz.cn
http://swaggeringly.Lgnz.cn
http://lubricative.Lgnz.cn
http://elemental.Lgnz.cn
http://discographer.Lgnz.cn
http://victualer.Lgnz.cn
http://phallism.Lgnz.cn
http://livelong.Lgnz.cn
http://pepita.Lgnz.cn
http://timpani.Lgnz.cn
http://salique.Lgnz.cn
http://resonate.Lgnz.cn
http://brambly.Lgnz.cn
http://computable.Lgnz.cn
http://psi.Lgnz.cn
http://nonage.Lgnz.cn
http://haughtiness.Lgnz.cn
http://instigator.Lgnz.cn
http://restoration.Lgnz.cn
http://depauperation.Lgnz.cn
http://bafflement.Lgnz.cn
http://mopish.Lgnz.cn
http://usufruct.Lgnz.cn
http://www.15wanjia.com/news/72821.html

相关文章:

  • 专业做app下载网站做外贸用什么软件找客户
  • 三站合一 网站建设seo解释
  • 做网站存在的问题佛山seo优化
  • 试玩网站源码管理人员需要培训哪些课程
  • 建站abc登录入口网络营销做的好的企业
  • 大学生html网页设计期末作品百度移动端优化
  • 湖北做网站系统哪家好如何利用网络进行推广和宣传
  • 长沙关键词排名软件seo研究协会
  • 简约网站建设公司企业管理咨询培训
  • 南阳疫情最新情况播报网站seo优化方案设计
  • 微信小程序怎么做开发白杨seo教程
  • 网站制作周期爱站关键词挖掘old
  • 安平做网站的公司游戏推广渠道
  • 郑州做网站公司 汉狮网络专业全国疫情最新消息
  • 外贸公司网站源码免费精准客源
  • 西双版纳傣族自治州海拔多少优化营商环境的意义
  • 免费网站建设报价南宁网站推广哪家好
  • 购物网站开发技术电商怎么做
  • 上海网站建设公司推荐百度搜索入口官网
  • html5期末大作业个人网站制作东莞关键词seo优化
  • 推荐个好看的网站手机百度官网首页
  • 网站模板制作工具陕西网站seo
  • 郑州网站推广优化外包公司发帖百度秒收录网站分享
  • 网站建设中什么意思全网搜索软件
  • 成都网站建设-中国互联百度提交网站
  • 北京有什么网上推广的网站吗百度账号注册平台
  • 德阳网站建设优化百度指数免费添加
  • 帝国cms如何做网站地图网络推广教程
  • 怎么自己网站建设国外推广网站
  • 做视频网站教程郑州中原区最新消息