采取Anaconda的方式
1.安装anacoda
下载anaconda,下面是清华镜像,下载最新的就可以了
Index of /anaconda/archive/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
安装之后将安装路径添加到系统环境变量
D:\ProgramData\Anaconda3\Scripts;
安装完成后创建一个虚拟环境
conda create -n xinference python=3.10 -y
然后启动该环境,刚创建完可能会报错,重开一个就可以了
conda activate xinference
在此环境下,更新pip并换源
python -m pip install --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
2.安装xinference
pip install "xinference[all]"
安装的时候会报错
Could not build wheels for chatglm-cpp, llama-cpp-python
这里实际上是两个错误,下面简而言之,如果看不懂,具体的解决方案参考http://t.csdnimg.cn/Eacf4
1. llama-cpp-python的问题,需要安装 vs
2. chatglm-cpp的问题,需要安装 https://github.com/li-plus/chatglm.cpp/releases
注意选择正确的版本,这里用的3.10的python
下载好后在本地用pip安装即可
这两个完成后,再安装就没有问题了
3.运行
xinference-local --host 127.0.0.1 --port 9997
打开
http://127.0.0.1:9997/ui/#/launch_model/llm
部署成功