简介
本次使用Windwos WSL 本地部署 QAnything大模型,本文章主要适合无适合显卡并且想体验QAnything的用户。
准备内容
WSL with Ubuntu 18.04+
MiniConda3
Openai API 相关内容(baseUrl,密钥,模型名称)
开始部署
进入WindwosWLS ubantu服务器,先进行下载代码。
Qanything在GitHub、码云均有相关代码,地址如下
码云:https://gitee.com/mirrors/qanything
Github:https://github.com/netease-youdao/QAnything
内容一样,可以根据自己的网络环境进行挑选,我使用的是码云,首先进行源码下载,并切换python分支。
git clone https://github.com/netease-youdao/QAnything
git branch -a
git checkout qanything-python
使用Conda进行创建虚拟环境
conda create -n qanything-python python=3.10
conda activate qanything-python
然后配置相关Pip国内源,直接按照下面相关文件即可
配置Pip国内源
下载相关依赖
pip install -r requirements.txt
修改执行脚本 run_for_openai_api_with_cpu_in_Linux_or_WSL.sh
原本内容
bash scripts/base_run.sh -s "LinuxOrWSL" -w 4 -m 19530 -q 8777 -c -o -b 'https://api.openai.com/v1' -k 'sk-xxx' -n 'gpt-3.5-turbo-1106' -l '4096'`
我们要修改 -b -k -n后面的字符串
-b是baseurl
-k是url的key值
-n是指模型名称
可以直接跳转通义千问获取相关值
最后执行,即可启动
bash scripts/run_for_openai_api_with_cpu_in_Linux_or_WSL.sh