赞
踩
[github]
1.装包部署
git clone https://github.com/mukulpatnaik/researchgpt.git
cd researchgpt
pip install -r requirements.txt
pip uninstall openai
pip install openai==0.27.7
设置环境变量:在环境变量里设置OPENAI_API_KEY,可以通过在命令提示符(CMD)或者PowerShell中输入echo %OPENAI_API_KEY%来验证环境变量是否设置成功。
需要拿到一个openaikey
运行
uvicorn main:app --reload
原版,无法运行,要改端口:
uvicorn main:app --host 127.0.0.1 --port 45144 --reload
而且终端要:
set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890
报错:redis.exceptions.ConnectionError: Error 10061 connecting to localhost:45183. 由 于目标计算机积极拒绝,无法连接。
解决方法:是由于没有启动redis服务,启动服务(找到安装路径,打开redis-servce.exe文件即可)。
报错:INFO: 127.0.0.1:52751 - “POST /process_pdf HTTP/1.1” 500 Internal Server Error
ERROR: Exception in ASGI application.
解析:the 127.0.0.1:64603 part is not the address and port the server is running on. Instead, it’s the address and port of the client that sent the HTTP request to the server.这个错误是由于下面那个错误导致的。
报错:Done creating dataframe
openai.error.RateLimitError: Rate limit reached for text-embedding-ada-002 in organization org-s7q4Pdq4wxWqju2UCefWy6uZ on requests per min (RPM): Limit 3, Used 3, Requested 1. Please try again in 20s
限制规则见openai文档。
curl http://localhost:19327/v1/completions \ -H “Content-Type: application/json” \ -d ‘{ “prompt”: “告诉我中国的首都在哪里” }’
python scripts/openai_server_demo/openai_api_server.py --base_model /path/to/base_model --lora_model /path/to/lora_model --gpus 0,1
不行,换方法 ,本地基于llama2部署
按照官方步骤一步步来即可。
一些要点:
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
安装make
choco install make
测试make是否成功安装
make --version
安装:pip install --user poetry
卸载:pip uninstall poetry
安装检查:
1、安装完成后要在环境变量新增一条poetry的环境变量
2、控制台执行poetry --version,出现Poetry version 表示安装成功
poetry install --with ui
poetry install --with local
下载模型
poetry run python scripts/setup
make run
端口号不是localhost
解决:在工程中ctrl+shift+f寻找uvicorn.run找到
# uvicorn.run(app, host="0.0.0.0", port=settings().server.port, log_config=None)
uvicorn.run(app, host="127.0.0.1", port=settings().server.port, log_config=None)
修改即可
然后再make run
啊啊啊啊啊啊终于成功了,接下来我要详细理解这个工程,以方便以后微调。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。