赞
踩
命令停止:
sudo systemctl stop ollama
sudo systemctl disable ollama.service
手动停止:在运行ollama的终端按ctrl+c
,停止服务
Linux: /usr/share/ollama/.ollama/models
sudo chown -R root:root /path/to/ollama/models
sudo chmod -R 775 /path/to/ollama/models
/path/to/ollama/models
是要更改的模型路径
sudo vim /etc/systemd/system/ollama.service
在原来的[Service]
Environment
后加一行新的Environment
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
ExecStart=/usr/local/bin/ollama serve
User=root
Group=root
Restart=always
RestartSec=3
Environment="PATH=/home/asus/anaconda3/bin:/home/asus/anaconda3/condabin:/home/asus/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin"
Environment="OLLAMA_MODELS=/path/to/ollama/models"
[Install]
WantedBy=default.target
这里注意User
和Group
都要设成root
sudo systemctl daemon-reload
可以删除默认的模型路径,让它重新生成
重启ollama:sudo systemctl restart ollama.service
查看状态:sudo systemctl status ollama
再进入默认的模型路径会发现model文件夹消失,设置的文件夹里生成了blobs
和manifests
文件夹
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。