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

企业网站建设原则有哪些安定网站建设

企业网站建设原则有哪些,安定网站建设,网页制作与网站开发,wordpress菜单html51. 导入GGUF 类型的模型 1.1 先在huggingface 下载需要ollama部署的大模型 1.2 编写modelfile 在ollama 里面输入 ollama show --modelfile <你有的模型名称> eg: ollama show --modelfile qwen2.5:latest修改其中的from 路径为自己的模型下载路径 FROM /Users/lzx/A…

1. 导入GGUF 类型的模型

1.1 先在huggingface 下载需要ollama部署的大模型

在这里插入图片描述

1.2 编写modelfile

在ollama 里面输入

ollama show --modelfile <你有的模型名称>
eg:
ollama show --modelfile qwen2.5:latest

修改其中的from 路径为自己的模型下载路径

FROM /Users/lzx/AI/llm/lmstudio-community/Llama-3-Groq-8B-Tool-Use-GGUF
TEMPLATE """{{- if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}# ToolsYou may call one or more functions to assist with the user query.You are provided with function signatures within <tools></tools> XML tags:
<tools>
{{- range .Tools }}
{"type": "function", "function": {{ .Function }}}
{{- end }}
</tools>For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
{{- end }}<|im_end|>
{{ end }}
{{- range $i, $_ := .Messages }}
{{- $last := eq (len (slice $.Messages $i)) 1 -}}
{{- if eq .Role "user" }}<|im_start|>user
{{ .Content }}<|im_end|>
{{ else if eq .Role "assistant" }}<|im_start|>assistant
{{ if .Content }}{{ .Content }}
{{- else if .ToolCalls }}<tool_call>
{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
{{ end }}</tool_call>
{{- end }}{{ if not $last }}<|im_end|>
{{ end }}
{{- else if eq .Role "tool" }}<|im_start|>user
<tool_response>
{{ .Content }}
</tool_response><|im_end|>
{{ end }}
{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
{{ end }}
{{- end }}
{{- else }}
{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
{{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}"""
SYSTEM You are watt-tool-8B, a helpful assistant with tool calling capabilities.
ollama create Llama-3-Groq-8B-Tool -f config.modelfile

执行创建就完成了

2.导入 safetensors 模型导入Ollama

2.1 先在huggingface 下载需要ollama部署的大模型

在这里插入图片描述

这里以llama-3为例子,下载所有的文件,或者使用git 拉代码库,需要git lfs
2.2 安装llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
pip install -r requirements.txt
2.3 格式转换

在llama.cpp的安装目录下,执行

python convert_hf_to_gguf.py "<你下载的模型路径>" --outtype f16 --verbose --outfile "<你要输出的文件位置>"
2.4 然后他就转换为GGUF格式了,就按GGUF格式的来就好啦

3.ollama量化

我发现ollama pull下来的模型大小比直接从huggingface下载下来的SAFE类型小很多,于是去ollama看了下大模型量化
https://github.com/ollama/ollama/blob/b51e0f397ced70bbfa7f22e9b3c94953967cb8e5/ml/backend/ggml/ggml/src/ggml-quants.h#L17
这个里面是一些常见的量化支持,这里我们选择的是q4_K_M
执行创建命令的时候带上
ollama create --quantize q4_K_M <你要在ollama中显示的模型名称> -f Modelfile
http://www.dtcms.com/wzjs/607535.html

相关文章:

  • 响应式布局模板网站免费下载政务公开网站建设情况
  • 网站优化技术网站如何添加图标
  • 合肥门户网站有哪些wordpress html5特效
  • 做门的网站建设营销型网站建设范文
  • 免费ppt课件下载网站企业网站的目的
  • 烟台网站建设设计wordpress阅读量的统计
  • 建设商城网站公司吗珠宝类网站模板
  • 苏宁电器网站建设特点分析公关公司电视剧
  • 用自己服务器做网站个人网站开发协议
  • 有没有做公司网站的二级造价工程师
  • 临沂科技学校网站建设wp网站搬家教程
  • 易货网站开发一下成都网站建设公司排名
  • 做军事网站的项目背景图片WordPress侧边栏跟随
  • 长春网站制作最专业商旅100网页版
  • 学校网站建设培训心得wordpress用户无法登录
  • 营销型网站sempkwordpress图片下载水印
  • 加盟产品网站建设方案建站系统有哪些
  • 怎么给老板提供网站建设资料做外贸经常用的网站
  • asp室内装修装潢网站源码珠海蓝迪装饰公司官网
  • 灵璧做网站如何恢复wordpress主题初始内容
  • 四川建设厅网站怎么进不去永州网络推广
  • 茌平网站建设公司wordpress修改顶部颜色
  • 北京时间网站建设wordpress移植数据库
  • 杭州论坛网站建设潍坊专业网站建设
  • 织梦 音乐网站网站做收录要多少长时间
  • 高端网站建设,恩愉科技wordpress删除文章
  • 网站优化找谁容县网站开发
  • 中建西部建设北方有限公司网站网站做cdn怎么弄
  • 广州网站建设studstu自我做t恤的网站
  • 织梦手机网站模板安装黄页推广软件哪个好