在Linux下安装Llama3可以分为几个步骤,以下是详细的教程:
打开终端,粘贴以下命令并回车:
curl -fsSL https://ollama.com/install.sh | sh这将自动下载并安装Ollama。
安装完成后,输入用户名和密码登录Ollama。
在Ollama的命令行界面中,输入以下命令下载8B模型:
ollama run llama3或者指定下载8B模型:
ollama run llama3:8b安装成功会有相应的提示。
由于Deepin Linux需要配置安装Docker CE及其相关工具,执行以下命令:
sudo apt-get install -y apt-transport-https ca-certificates curl python-software-properties software-properties-common添加Docker CE的官方GPG密钥:
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/debian/gpg | sudo apt-key add -根据Deepin基于的Debian版本添加官方仓库,例如Deepin基于Debian 10.5(代号为buster),则添加以下仓库:
deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/debian buster stable安装Docker:
sudo apt-get update
sudo apt-get install -y docker-ce启动Docker服务:
sudo systemctl start docker检查Docker安装是否成功:
docker --version使用Docker运行OpenWebUI:
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main或者使用国内下载源:
docker run -d -p 3000:8080 --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main查看机器的IP地址以访问OpenWebUI。
编辑环境变量文件,设置Ollama服务器的监听地址和端口号:
export OLLAMA_HOST=IP_Address_for_the_ollama_server
export OLLAMA_NOHISTORY=true默认端口号为11434。
通过以上步骤,您可以在Linux系统下成功安装并运行Llama3模型。希望这个教程对您有所帮助!如果有任何问题,请随时联系相关社区或支持团队。