add RWKV-Runner WebUI to Server-Deploy-Examples
This commit is contained in:
parent
0c3a50cb07
commit
07797537d1
18
deploy-examples/RWKV-Runner-WebUI/setup.bat
Normal file
18
deploy-examples/RWKV-Runner-WebUI/setup.bat
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
: install git python3.10 npm by yourself
|
||||||
|
: change model and strategy according to your hardware
|
||||||
|
|
||||||
|
git clone https://github.com/josStorer/RWKV-Runner --depth=1
|
||||||
|
python -m pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --index-url https://download.pytorch.org/whl/cu117
|
||||||
|
python -m pip install -r RWKV-Runner/backend-python/requirements.txt
|
||||||
|
cd RWKV-Runner/frontend
|
||||||
|
call npm ci
|
||||||
|
call npm run build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
start python ./backend-python/main.py --webui
|
||||||
|
start "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "http://127.0.0.1:8000"
|
||||||
|
|
||||||
|
powershell -Command "(Test-Path ./models) -or (mkdir models)"
|
||||||
|
powershell -Command "Import-Module BitsTransfer"
|
||||||
|
powershell -Command "(Test-Path ./models/RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth) -or (Start-BitsTransfer https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth ./models/RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth)"
|
||||||
|
powershell -Command "Invoke-WebRequest http://127.0.0.1:8000/switch-model -Method POST -ContentType 'application/json' -Body '{\"model\":\"./models/RWKV-4-World-1.5B-v1-fixed-20230612-ctx4096.pth\",\"strategy\":\"cuda fp32 *20+\",\"deploy\":\"true\"}'"
|
21
deploy-examples/RWKV-Runner-WebUI/setup.sh
Normal file
21
deploy-examples/RWKV-Runner-WebUI/setup.sh
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# install git python3.10 npm by yourself
|
||||||
|
# change model and strategy according to your hardware
|
||||||
|
|
||||||
|
sudo apt install python3-dev
|
||||||
|
|
||||||
|
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
|
||||||
|
cd RWKV-Runner/frontend
|
||||||
|
npm ci
|
||||||
|
npm run build
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
python3 ./backend-python/main.py --webui > log.txt &
|
||||||
|
|
||||||
|
if [ ! -d models ]; then
|
||||||
|
mkdir models
|
||||||
|
fi
|
||||||
|
wget -N https://huggingface.co/BlinkDL/rwkv-4-world/resolve/main/RWKV-4-World-0.1B-v1-20230520-ctx4096.pth -P models/
|
||||||
|
|
||||||
|
curl http://127.0.0.1:8000/switch-model -X POST -H "Content-Type: application/json" -d '{"model":"./models/RWKV-4-World-0.1B-v1-20230520-ctx4096.pth","strategy":"cpu fp32","deploy":"true"}'
|
Loading…
Reference in New Issue
Block a user