From d3473ba24f4c13af734c66cf4676a89b3c445c4e Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 15 Mar 2025 19:19:33 +0800 Subject: [PATCH] bugfix --- qwq32b/params.ui | 3 +++ qwq32b/qwq32b.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 qwq32b/params.ui create mode 100644 qwq32b/qwq32b.sh diff --git a/qwq32b/params.ui b/qwq32b/params.ui new file mode 100644 index 0000000..0db3279 --- /dev/null +++ b/qwq32b/params.ui @@ -0,0 +1,3 @@ +{ + +} diff --git a/qwq32b/qwq32b.sh b/qwq32b/qwq32b.sh new file mode 100644 index 0000000..c1cc461 --- /dev/null +++ b/qwq32b/qwq32b.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# 变量 +# +# home +# user +# passwd +# +# 开始要检查安装nvidia驱动 + +create_user() +{ + sudo deluser {{user}} + sudo delgroup {{user}} + sudo useradd -m -g {{user}} -s bash -d {{home}} {{user}} + echo "{{user}}:{{passwd}}" | sudo chpasswd {{user}} +} +curusr=$(id -un) +curgrp=$(id -gn) +sudo apt install git-lfs +sudo rm -rf {{home}} +sudo mkdir {{home}} +sudo chown -R $(curusr):$(curgrp) $(home) +sudo apt -y install python3-venv +mkdir {{home}}/.pip +cat < {{home}}/.pip/pip.conf +[global] +index-url = https://pypi.tuna.tsinghua.edu.cn/simple +[install] +trusted-host = https://pypi.tuna.tsinghua.edu.cn +EOF +cat <{{home}}/run.sh +#!/bin/bash + +~/py3/bin/python -m vllm.entrypoints.openai.api_server --model ./QwQ-32B --served-model-name qwq: +32b --gpu-memory-utilization 0.9 --max_model_len 40960 --tensor-parallel-size 4 +EOF +chmod +x {{home}}/run.sh +sudo cat </etc/systemd/system/{{user}}.service +[Unit] +Wants=systemd-networkd.service +Requires=nginx.service + +[Service] +Type=forking +ExecStart=su - {{user}} -c "{{home}}/run.sh" +ExecStop=su - {{user}} "killname vllm" +[Install] +WantedBy=multi-user.target +EOF +python3 -m venv {{home}}/py3 +{{home}}/py3/bin/pip install vllm +create_user +sudo chown -R {{user}}:{{user}} {{home}} +systemctl enable {{user}}.service +systemctl start {{user}}.service + +exit 0