-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_llama3_vllm_localhost.sh
66 lines (57 loc) · 1.9 KB
/
run_llama3_vllm_localhost.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
export USE_AZURE='false';
export OPENAI_API_BASE=http://localhost:7035/v1;
export model=${1:-/tmp/llama3.2-11b-vision-chat/}
export website=${2:-shopping}
export instruction_path=${3:-configs/p_cot_id_actree_3s.json}
export ngpu=${4:-2}
export chat_template=${5:-llama3x/chat_template_llama3.2.jinja}
echo "USE_AZURE: $USE_AZURE"
echo "OPENAI_API_BASE: $OPENAI_API_BASE"
echo "Model: $model"
echo "chat_template: $chat_template"
echo "website: $website"
echo "instruction_path: $instruction_path"
echo "number of gpus: $ngpu"
if ! nc -z localhost 7035; then
random_id=$(( $RANDOM % 1000 ))
echo "Server output is redirected to: /tmp/vllm_server_logs_$random_id.out"
nohup vllm serve --port 7035 \
$model \
--dtype auto \
--api-key EMPTY \
--chat-template $chat_template \
--tensor-parallel-size $ngpu \
--gpu-memory-utilization 0.8 \
--max-model-len 24000 \
--max-num-seqs 8 \
--enforce-eager > /tmp/vllm_server_logs_$random_id.out &
else
echo "Server is already running"
fi
while ! nc -z localhost 7035; do
sleep 15
echo "... still offline"
done
sleep 10
if [[ $instruction_path == *"som"* ]]; then
action_set_tag=som
observation_type=image_som
else
action_set_tag=id_accessibility_tree
observation_type=accessibility_tree
fi
echo "action_set_tag: $action_set_tag"
echo "observation_type: $observation_type"
python -u run_agentdam.py \
--instruction_path $instruction_path \
--result_dir ./results/$website/ \
--test_config_base_dir=data/wa_format/${website}_privacy/ \
--model $model \
--action_set_tag $action_set_tag \
--observation_type $observation_type \
--temperature 0 \
--max_steps 10 \
--viewport_height 1280 \
--privacy_test