docker镜像封装
docker安装(略…)
拉取ollama镜像
docker pull ollama/ollama # 约1.98G
运行ollama容器
# 前一个11435是宿主机要对外暴露的tcp端口,可自定义修改
docker run -d -p 11435:11434 --name ollama ollama/ollama
准备模型注册文件
文件名称为Modelfile
,如可以使用 vim Modelfile,写入数据如下
FROM Qwen2.5-3B-Instruct-Q4_K_L.gguf
# set the temperature to 1 [higher is more creative, lower is more coherent]
PARAMETER temperature 0.7
PARAMETER top_p 0.8
PARAMETER repeat_penalty 1.05
PARAMETER top_k 20
TEMPLATE """{
{ if .Messages }}
{
{- if or .System .Tools }}<|im_start|>system
{
{ .System }}
{
{- if .Tools }}
# Tools
You are provided with function signatures within <tools></tools> XML tags:
<tools>{
{- range .Tools }}
{"type": "function", "function":