-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathstart_server.sh
More file actions
46 lines (36 loc) · 1.11 KB
/
start_server.sh
File metadata and controls
46 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
num_images=25
model=models/steve_7b_sft
model_name=cot_qwen2vl
# model=models/UI-TARS-7B-DPO
# model_name=ui-tars
# num_images=5
port=9000
ground_model=models/UI-TARS-7B-DPO
# Function to clean up processes on exit
cleanup() {
echo "Stopping all processes..."
pkill -P $$ # Kill all child processes of this script
exit 0
}
# Trap SIGINT (Ctrl+C) and SIGTERM to run cleanup function
trap cleanup SIGINT SIGTERM
# Start processes
for i in {0..6}; do
CUDA_VISIBLE_DEVICES=$i python -m vllm.entrypoints.openai.api_server \
--served-model-name $model_name \
--model $model \
--limit-mm-per-prompt image=$num_images \
--chat-template ./chat_template_qwen2vl.jinja \
-tp=1 \
--port $((9000 + i)) &
# --chat-template $model/chat_template.json\ # wrong, use vllm default with low Temperature
done
CUDA_VISIBLE_DEVICES=7 python -m vllm.entrypoints.openai.api_server \
--served-model-name ui-tars \
--model $ground_model \
--chat-template ./chat_template_qwen2vl.jinja \
-tp=1 \
--port 8001 &
# Wait to keep the script running
wait