From 6ec6044901d71d126859786617e222688812b5b7 Mon Sep 17 00:00:00 2001 From: josc146 Date: Thu, 8 Jun 2023 00:07:08 +0800 Subject: [PATCH] deploy example for linux --- build/linux/Readme_Install.txt | 1 + deploy-examples/ChatGPT-Next-Web/setup.bat | 3 +++ deploy-examples/ChatGPT-Next-Web/setup.sh | 27 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 deploy-examples/ChatGPT-Next-Web/setup.sh diff --git a/build/linux/Readme_Install.txt b/build/linux/Readme_Install.txt index 32e4f70..c55a422 100644 --- a/build/linux/Readme_Install.txt +++ b/build/linux/Readme_Install.txt @@ -6,6 +6,7 @@ On Linux system, this program cannot invoke the terminal for automatic dependenc 在Linux系统下, 本程序无法调用终端自动安装依赖, 你必须手动执行以下命令进行安装, 之后方可正常使用: Linuxシステムでは、このプログラムはターミナルを自動的に呼び出して依存関係をインストールすることができません。以下のコマンドを手動で実行する必要があります。それが完了した後に、正常に使用することができます: +sudo apt install python3-dev chmod +x ./RWKV-Runner ./RWKV-Runner cd backend-python diff --git a/deploy-examples/ChatGPT-Next-Web/setup.bat b/deploy-examples/ChatGPT-Next-Web/setup.bat index eacab2b..7f3b3be 100644 --- a/deploy-examples/ChatGPT-Next-Web/setup.bat +++ b/deploy-examples/ChatGPT-Next-Web/setup.bat @@ -1,3 +1,6 @@ +: install git python3.10 yarn by yourself +: change model and strategy according to your hardware + mkdir RWKV-Next-Web cd RWKV-Next-Web diff --git a/deploy-examples/ChatGPT-Next-Web/setup.sh b/deploy-examples/ChatGPT-Next-Web/setup.sh new file mode 100644 index 0000000..e3b28b7 --- /dev/null +++ b/deploy-examples/ChatGPT-Next-Web/setup.sh @@ -0,0 +1,27 @@ +# install git python3.10 yarn by yourself +# change model and strategy according to your hardware + +sudo apt install python3-dev + +mkdir RWKV-Next-Web +cd RWKV-Next-Web + +git clone https://github.com/josStorer/RWKV-Runner --depth=1 +python3 -m pip install torch torchvision torchaudio +python3 -m pip install -r RWKV-Runner/backend-python/requirements.txt +python3 ./RWKV-Runner/backend-python/main.py > log.txt & + +if [ ! -d RWKV-Runner/models ]; then + mkdir RWKV-Runner/models +fi +wget -N https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-0.1B-v1-20230520-ctx4096.pth -P RWKV-Runner/models/ + +git clone https://github.com/Yidadaa/ChatGPT-Next-Web --depth=1 +cd ChatGPT-Next-Web +yarn install +yarn build +export PROXY_URL="" +export BASE_URL=http://127.0.0.1:8000 +yarn start & + +curl http://127.0.0.1:8000/switch-model -X POST -H "Content-Type: application/json" -d '{"model":"./RWKV-Runner/models/RWKV-4-World-0.1B-v1-20230520-ctx4096.pth","strategy":"cpu fp32"}'