创建 Llama-3.1-70B-Japanese-Instruct-2407 的 Ollama 模型

news2024/9/9 1:13:47

创建 Llama-3.1-70B-Japanese-Instruct-2407 的 Ollama 模型

  • 1. 下载 gguf 文件
  • 2. 创建 Modelfile
  • 3. 创建 Ollama 模型
  • 4. 运行 Ollama 模型
  • 5. (可选)其他 Modelfile

1. 下载 gguf 文件

使用浏览器打开 https://huggingface.co/mmnga/Llama-3.1-70B-Japanese-Instruct-2407-gguf,下载你想使用的量化版本。

例如,Llama-3.1-70B-Japanese-Instruct-2407-Q4_K_M.gguf

在这里插入图片描述

2. 创建 Modelfile

创建 Modelfile,内容如下,

# ollama create llama3.1:70b-japanese-tool-q4_K_M -f ./Modelfile

FROM ./Llama-3.1-70B-Japanese-Instruct-2407-Q4_K_M.gguf
TEMPLATE "{{ if .Messages }}
{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|>
{{- if .System }}

{{ .System }}
{{- end }}
{{- if .Tools }}

You are a helpful assistant with tool calling capabilities. When you receive a tool call response, use the output to format an answer to the orginal use question.
{{- end }}<|eot_id|>
{{- end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 }}
{{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|>
{{- if and $.Tools $last }}

Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt.

Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables.

{{ $.Tools }}
{{- end }}

{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>

{{ end }}
{{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|>
{{- if .ToolCalls }}

{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }}
{{- else }}

{{ .Content }}{{ if not $last }}<|eot_id|>{{ end }}
{{- end }}
{{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|>

{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|>

{{ end }}
{{- end }}
{{- end }}
{{- else }}
{{- if .System }}<|start_header_id|>system<|end_header_id|>

{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>

{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>

{{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}
"
PARAMETER stop <|start_header_id|>
PARAMETER stop <|end_header_id|>
PARAMETER stop <|eot_id|>

3. 创建 Ollama 模型

运行下面命令创建 Ollama 模型,

ollama create llama3.1:70b-japanese-tool-q4_K_M -f ./Modelfile

4. 运行 Ollama 模型

ollama run llama3.1:70b-japanese-tool-q4_K_M

5. (可选)其他 Modelfile

下面是不支持执行 tool 的 Modelfile。

FROM ./Llama-3.1-70B-Japanese-Instruct-2407-Q4_K_M.gguf
TEMPLATE "{{- if .Messages }}
{{- if .System }}<|start_header_id|>system<|end_header_id|>

{{ .System }}<|eot_id|>
{{- end }}
{{- range .Messages }}<|start_header_id|>{{ .Role }}<|end_header_id|>

{{ .Content }}<|eot_id|>
{{- end }}<|start_header_id|>assistant<|end_header_id|>

{{ else }}
{{- if .System }}<|start_header_id|>system<|end_header_id|>

{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|>

{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|>

{{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}"
PARAMETER stop <|start_header_id|>
PARAMETER stop <|end_header_id|>
PARAMETER stop <|eot_id|>

完结!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1958870.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

DELL服务器RAID配置详细教程

DELL服务器RAID配置教程 在启动电脑的时候按CTRLR 进入 RAID 设置见面如下图 名称解释&#xff1a; Disk Group&#xff1a;磁盘组&#xff0c;这里相当于是阵列&#xff0c;例如配置了一个RAID5&#xff0c;就是一个磁盘组 VD(Virtual Disk)&#xff1a; 虚拟磁盘&#xff…

FFmpeg模块详解:深入理解多媒体框架的构成

&#x1f60e; 作者介绍&#xff1a;欢迎来到我的主页&#x1f448;&#xff0c;我是程序员行者孙&#xff0c;一个热爱分享技术的制能工人。计算机本硕&#xff0c;人工制能研究生。公众号&#xff1a;AI Sun&#xff08;领取大厂面经等资料&#xff09;&#xff0c;欢迎加我的…

为了人才任正非一个月蹲守人家单位门口,刘备三顾茅庐算啥!

张一鸣说&#xff1a;"一名优秀的CEO首先应该是优秀的HR&#xff01;”这句话广为流传&#xff0c;此言差矣&#xff0c;一名卓越的创始人首先应该是最卓越的猎头&#xff0c;比如任正非&#xff01; 全球的创始人也没几个人能够做像任正非那样重视人才的&#xff0c;一旦…

成为git砖家(7): posh-git的安装和使用

文章目录 1. PowerShell 里的 git 默认使用体验不够好2. posh-git 介绍2.1 安装 posh-git2.2 PS1 显示的内容2.3 补全分支 1. PowerShell 里的 git 默认使用体验不够好 在 Windows 系统上&#xff0c;安装了 git for windows 后&#xff0c; git bash 里的体验确实不错。 但是…

【云原生】kubernetes弃用docker,containerd风华正茂,何以承载云原生?

✨✨ 欢迎大家来到景天科技苑✨✨ &#x1f388;&#x1f388; 养成好习惯&#xff0c;先赞后看哦~&#x1f388;&#x1f388; &#x1f3c6; 作者简介&#xff1a;景天科技苑 &#x1f3c6;《头衔》&#xff1a;大厂架构师&#xff0c;华为云开发者社区专家博主&#xff0c;…

JAVA基础 - 泛型

目录 一. 简介 二. 集合泛型 三. 自定义泛型 四. 自定义泛型类和普通类的区别 一. 简介 泛型是 Java 语言中一种强大的特性&#xff0c;它允许在定义类、接口和方法时使用类型参数&#xff0c;从而增加了代码的类型安全性和复用性。 类型安全性&#xff1a; 使用泛型可以…

leetcode日记(60)编辑距离

感觉这题不是按难度划分的而是按代码长度划分的…看了答案才知道怎么做&#xff0c;其实思路很简单&#xff0c;但是特别难想…… 意思是使用动态规划&#xff0c;依次计算由word1的前i个字母到word2的前j个字母要经历的最小变化数。 min D[i][j]min(D[i-1][j]1,D[i][j-1]1,D…

spring 中包自动扫描之 component-scan 解析

在 spring 中&#xff0c;为简化 bean 的配置&#xff0c;在 spring-context 模块下提供了包的自动扫描功能&#xff0c;将配置的包及其子包下的所有符合条件的类都注册到 BeanFactory 中。下面来看下具体是怎么实现的。 配置 <context:component-scan base-package"…

【MIT 6.5840(6.824)学习笔记】Raft

1 脑裂 许多容错系统使用一个单主节点来决定主副本。 MapReduce&#xff1a;由单主节点控制计算复制。GFS&#xff1a;主备复制数据&#xff0c;并由单主节点确定主拷贝的位置。VMware FT&#xff1a;主虚机和备份虚机之间复制指令&#xff0c;需要单点的Test-and-Set服务确认…

[0729] X-CMD 发布 v0.4.3:借助 fzf ,提升用户使用体验

目录 X-CMD 发布 v0.4.3&#x1f50e; ll&#x1f50e; jq&#x1f50e; yq&#x1f50e; man X-CMD 发布 v0.4.3 &#x1f50e; ll 新增 --fzf 子命令 该命令借助 fzf 为用户提供了一种高效查找文件和目录的相关信息的方法&#xff0c;类似于文件管理器。 # 使用 fzf 查找文…

AI智能名片O2O商城小程序源码在社区团购中的应用与红利深度探索

摘要&#xff1a;在数字化转型的浪潮中&#xff0c;社区团购以其独特的商业模式和强大的市场渗透力&#xff0c;成为新零售领域的一股不可忽视的力量。而AI智能名片O2O商城小程序源码&#xff0c;作为技术创新的集大成者&#xff0c;正逐步渗透并深刻改变着社区团购的运作模式和…

从零开始编写一个Chrome插件:详细教程

个人名片 🎓作者简介:java领域优质创作者 🌐个人主页:码农阿豪 📞工作室:新空间代码工作室(提供各种软件服务) 💌个人邮箱:[2435024119@qq.com] 📱个人微信:15279484656 🌐个人导航网站:www.forff.top 💡座右铭:总有人要赢。为什么不能是我呢? 专栏导…

科普文:抽屉合同/协议

抽屉协议是指一种在特定情境下&#xff0c;当事人之间私下签订的、不公开披露的协议。通常情况下&#xff0c;除了协议双方外&#xff0c;其他人并不知道这份协议的存在。这种协议在需要时会被拿出来&#xff0c;因为它已经过双方签字盖章&#xff0c;同样具有法律效应。 背景…

SN65MLVD080使用手册

8通道半双工M-LVDS线路收发器 特性 低压差分30欧姆至55欧姆线路驱动器和接收器&#xff0c;支持信号速率高达250 Mbps&#xff1b;时钟频率高达125 MHz 满足或超过M-LVDS标准TIA/EIA-899多点数据交换规范 受控驱动器输出电压转换时间&#xff0c;提高信号质量 -1V至3.4V共模…

【C++版本】protobuf与gRPC

文章目录 一、Protobuf二、安装以及使用protoc参考 一、Protobuf Google Protocol Buffers&#xff08;protobuf&#xff09;是一种语言中立、平台中立的序列化协议&#xff0c;旨在高效地将结构化数据进行序列化和反序列化。它主要用于通信协议、数据存储和其他需要高效编码和…

【CAN通讯系列5】CAN数据帧及其仲裁

在CAN通讯系列3-CAN通讯如何传递信号中&#xff0c;由于传递信号的分析需要&#xff0c;引出了CAN数据帧的ID&#xff0c;长度和数据段的概念&#xff0c;它们都与CAN协议帧相关。CAN协议帧有5种类型&#xff0c;如下表&#xff1a; 而我们当前使用到的是数据帧&#xff0c;故本…

【Qwen-Audio部署实战】Qwen-Audio-Chat模型之FastApi部署实战

系列篇章&#x1f4a5; No.文章1【Qwen部署实战】探索Qwen-7B-Chat&#xff1a;阿里云大型语言模型的对话实践2【Qwen2部署实战】Qwen2初体验&#xff1a;用Transformers打造智能聊天机器人3【Qwen2部署实战】探索Qwen2-7B&#xff1a;通过FastApi框架实现API的部署与调用4【Q…

10 BERT

目录 1 综述 1.1 BERT的核心思想 1.2 BERT的关键技术&#xff1a;预训练阶段 1.3 微调阶段 2 BERT的架构 2.1 输入处理 3. 特征选择/学习模块 BERT 的自注意力过程 4. 预训练任务&#xff1a;同时进行 4.1 Next Sentence Prediction (NSP) 4.2 Masked Language Model…

Url图标实现

Url图标实现 效果如下&#xff1a; 1.引入样式 <link rel"icon" href"favicon.ico"> favicon.ico和对应的html一般需要在同一个目录下&#xff08;同级别&#xff09;。 2.title是用来设置在url页签中显示的名称。 可能存在的问题&#xff1a; …

如何通过前端表格控件实现自动化报表?

背景 最近伙伴客户的项目经理遇见一个问题&#xff0c;他们在给甲方做自动化报表工具&#xff0c;项目已经基本做好了&#xff0c;但拿给最终甲方&#xff0c;业务人员不太买账&#xff0c;项目经理为此也是天天抓狂&#xff0c;没有想到合适的应对方案。 现阶段主要面临的问…