使用ollama运行llama3.1遇到问题+手工升级ollama

llama3大模型在前两天新出了3.1版本,听说比Chat gpt4还好,今天有空拉了一个模型试试:
# ollama pull llama3.1:8b
pulling manifest
pulling 87048bcd5521... 100% ▕██████████████████████████████████████████████████████▏ 4.7 GB
pulling 8cf247399e57... 100% ▕██████████████████████████████████████████████████████▏ 1.7 KB
pulling f1cd752815fc... 100% ▕██████████████████████████████████████████████████████▏  12 KB
pulling 56bb8bd477a5... 100% ▕██████████████████████████████████████████████████████▏   96 B
pulling e711233e7343... 100% ▕██████████████████████████████████████████████████████▏  485 B
verifying sha256 digest
writing manifest
removing any unused layers
success
模型顺利的下载下来了,但是运行时出错闪退:
# ollama run llama3.1
>>> ?
 It looks like your question is incomplete. Can you please ask me a question or provide more context? I'll do my
best to help!
>>> 你好
Error: template: :28:7: executing "" at <.ToolCalls>: can't evaluate field ToolCalls in type *api.Message

#

原因是:ollama 版本太低了只有0.2.5,解决办法是升级至0.3.0,使用安装命令升级,两次都不成功,如下:
# curl -fsSL https://ollama.com/install.sh | sh
>>> Downloading ollama...
######################################################################## 100.0%#=#=-#  #
curl: (56) OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0

# curl -fsSL https://ollama.com/install.sh | sh
>>> Downloading ollama...
######################################################################## 100.0%#=#=-#  #
curl: (28) Failed to connect to github.com port 443: 连接超时   #   #   #

只好手工下载文件来操作,因为ollama只有一个文件,好几百兆:
# whereis ollam
ollama: /usr/local/bin/ollama /usr/share/ollama
原来ollama安装到了/usr/local/bin下:
# cd /usr/local/bin
# ll
总用量 493696
-rwxr-xr-x. 1 root root 505541816  7月 16 12:04 ollama

下载ollama的linux-amd64版本的文件:

# wget https://ollama.com/download/ollama-linux-amd64
--2024-07-31 15:07:44--  https://ollama.com/download/ollama-linux-amd64
正在解析主机 ollama.com (ollama.com)... 34.120.132.20
正在连接 ollama.com (ollama.com)|34.120.132.20|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 307 Temporary Redirect
位置:https://github.com/ollama/ollama/releases/download/v0.3.0/ollama-linux-amd64 [跟随至新的 URL]
--2024-07-31 15:07:45--  https://github.com/ollama/ollama/releases/download/v0.3.0/ollama-linux-amd64
正在解析主机 github.com (github.com)... 20.205.243.166
正在连接 github.com (github.com)|20.205.243.166|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Found
位置:https://objects.githubusercontent.com/github-production-release-asset-2e65be/658928958/fccefa83-c1e7-4c85-a149-b52baf86bb45?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240731%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240731T070746Z&X-Amz-Expires=300&X-Amz-Signature=a86d836e0156a573828fbf26895f33827e23a28758cff2c0599b2b436e55949d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=658928958&response-content-disposition=attachment%3B%20filename%3Dollama-linux-amd64&response-content-type=application%2Foctet-stream [跟随至新的 URL]
--2024-07-31 15:07:46--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/658928958/fccefa83-c1e7-4c85-a149-b52baf86bb45?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240731%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240731T070746Z&X-Amz-Expires=300&X-Amz-Signature=a86d836e0156a573828fbf26895f33827e23a28758cff2c0599b2b436e55949d&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=658928958&response-content-disposition=attachment%3B%20filename%3Dollama-linux-amd64&response-content-type=application%2Foctet-stream
正在解析主机 objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.111.133, ...
正在连接 objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:585598488 (558M) [application/octet-stream]
正在保存至: “ollama-linux-amd64”

ollama-linux-amd64            100%[================================================>] 558.47M   600KB/s  用时 13m 55s

2024-07-31 15:21:41 (685 KB/s) - 已保存 “ollama-linux-amd64” [585598488/585598488])
下载文件还算顺利,下面添加执行权限:
# ls
ollama  ollama-linux-amd64
# chmod +x ollama-linux-amd64
检查版本:
# ./ollama-linux-amd64 -v
ollama version is 0.2.5
Warning: client version is 0.3.0
停止ollama服务:
# systemctl stop ollama.service
# ./ollama-linux-amd64 -v //再次检查版本
Warning: could not connect to a running Ollama instance
Warning: client version is 0.3.0
修改文件:将原文件备份,新建连接文件指向新下载的文件,如下:
# ls
ollama  ollama-linux-amd64
# mv ollama ollama.0.2.5
# ls
ollama.0.2.5  ollama-linux-amd64
# ln -s ollama-linux-amd64 ollama
#  ls -al
总用量 1065576
drwxr-xr-x.  2 root root        66  7月 31 15:45 .
drwxr-xr-x. 15 root root      4096  6月 25 22:23 ..
lrwxrwxrwx.  1 root root        18  7月 31 15:45 ollama -> ollama-linux-amd64
-rwxr-xr-x.  1 root root 505541816  7月 16 12:04 ollama.0.2.5
-rwxr-xr-x.  1 root root 585598488  7月 26 07:50 ollama-linux-amd64
# ollama -v
Warning: could not connect to a running Ollama instance
Warning: client version is 0.3.0
启动服务:
# systemctl start ollama.service
# ollama -v //不报Warning了。
ollama version is 0.3.0
运行llama3.1大模型:一切正常。
ollama run llama3.1
>>> ?
It looks like you might have accidentally submitted a question without actually asking one. Don't worry, it
happens to the best of us!
>>> /bye //退出
到open webui测试也OK。

  • 9
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值