-
Notifications
You must be signed in to change notification settings - Fork 26
/
run_demo.sh
executable file
·68 lines (54 loc) · 1.3 KB
/
run_demo.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
67
68
#!/bin/bash
pkill --signal 9 -f llava.serve.controller
pkill --signal 9 -f llava.serve.model_worker
pkill --signal 9 -f lama_server
pkill --signal 9 -f llava_interactive
eval "$(conda shell.bash hook)"
# Check if --debug is in the command line arguments
if [[ " $* " == *" --debug "* ]]; then
RUN_LLAVA_INT=False
else
RUN_LLAVA_INT=True
fi
echo "RUN_LLAVA_INT: $RUN_LLAVA_INT"
(
cd LLaVA
pwd
conda deactivate
conda activate llava
export HOST_ADDRESS="0.0.0.0"
export CONTROLLER_PORT=10000
export MODEL_WORKER_PORT=40000
python -m llava.serve.controller \
--host $HOST_ADDRESS \
--port $CONTROLLER_PORT &
python -m llava.serve.model_worker \
--host $HOST_ADDRESS \
--controller http://localhost:$CONTROLLER_PORT \
--port $MODEL_WORKER_PORT \
--worker http://localhost:$MODEL_WORKER_PORT \
--model-path ./llava-v1.5-13b &
)
sleep 30
(
cd lama
pwd
conda deactivate
conda activate lama
export TORCH_HOME=$(pwd)
export PYTHONPATH=$(pwd)
python ../lama_server.py &
)
sleep 10
if [ "$RUN_LLAVA_INT" = "True" ]; then
(
pwd
conda deactivate
conda activate llava_int
export LLAVA_INTERACTIVE_HOME=.
export GRADIO_NO_RELOAD=True
python llava_interactive.py
)
else
echo "Skipping llava_interactive.py because --debug was given."
fi