autoDL算力云装Xinference[坑与步骤]
租用服务器
先租用一个合适的服务器,建议不要选最新版本,跟我选的一样即可,不然后面会出现ERROR: Could not find a version that satisfies the requirement torch==2.1.2
问题1:默认装在系统盘爆满
🚫 不要直接使用以下命令
# 创建名为 Xinference 的 Conda 环境,并指定 Python 版本为 3.10.14
conda create -n Xinference python=3.10.14# 激活该环境
conda activate Xinferencepip install "xinference" -i https://pypi.tuna.tsinghua.edu.cn/simple
会出现系统盘爆满
ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device
✅ 正确方法:
# 设置临时目录和 pip 缓存目录
export TMPDIR=/root/autodl-tmp/tmp
mkdir -p $TMPDIRpip3 install "xinference[all]" \--cache-dir=/root/autodl-tmp/pip-cache \-i https://pypi.tuna.tsinghua.edu.cn/simple
这一步成功绕开了系统盘空间限制。如果仍报错,可以考虑清理系统盘(笔者没有用这步,运行顺利):
# 清理 pip 缓存
rm -rf ~/.cache/pip# 清理 apt 缓存
sudo apt-get clean# 查找占空间的文件夹
du -h --max-depth=1 / | sort -hr
问题2:Cmake 版本问题
使用该命令可解决
CMAKE_POLICY_VERSION_MINIMUM=3.22 pip3 install "xinference" \--cache-dir=/root/autodl-tmp/pip-cache \-i https://pypi.tuna.tsinghua.edu.cn/simple
启动服务
nohup xinference-local --host 0.0.0.0 --port 9997 & > output.log
需要配置下远程代理
点击下面链接即可打开
问题3:模型下载失败
在页面直接点击下载会出现下着下载进度条消失,试了几次才出现这个报错,现在我们就继续安装缺少的包吧
执行命令pip install sentence-transformers
恭喜!下载成功