mattb512 commited on
Commit
d3d1749
1 Parent(s): e5c817a

add shell function

Browse files
Files changed (1) hide show
  1. startup.sh +16 -42
startup.sh CHANGED
@@ -13,34 +13,15 @@ python3 -c "import torch; \
13
  print(f\"device count = {torch.cuda.device_count()}\"); \
14
  print(f\"current device = {torch.cuda.current_device()}\")"
15
 
16
- RUN_AND_WAIT() {
17
- # 1st param: the script name, eg "server.controller"
18
- # 2nd param: the command to execute
19
- # 3rd param: the log entry to watch for that indicate the component is ready
20
- COMPONENT=$1
21
- echo "Starting $COMPONENT"
22
- nohup eval $2 2>&1 | tee "$COMPONENT.log" &
23
- while [ `grep -c $3 "$COMPONENT.log"` -eq '0' ];do
24
- sleep 1s;
25
- echo "wait $COMPONENT to be running"
26
- done
27
- echo "$COMPONENT is running"
28
- }
29
-
30
- COMPONENT="serve.controller"
31
- COMMAND=python3 -m $COMPONENT --host 0.0.0.0 --port 10000
32
- READY_LOG="Uvicorn running on"
33
-
34
- RUN_AND_WAIT $COMPONENT $COMMAND $READY_LOG
35
-
36
- # COMPONENT="serve.controller"
37
- # echo "Starting $COMPONENT"
38
- # nohup python3 -m $COMPONENT --host 0.0.0.0 --port 10000 2>&1 | tee "$COMPONENT.log" &
39
- # while [ `grep -c "Uvicorn running on" "$COMPONENT.log"` -eq '0' ];do
40
- # sleep 1s;
41
- # echo "wait $COMPONENT to be running"
42
- # done
43
- # echo "$COMPONENT is running"
44
 
45
 
46
  # sleep 30
@@ -53,21 +34,14 @@ RUN_AND_WAIT $COMPONENT $COMMAND $READY_LOG
53
 
54
  # echo "Starting prism-dinosiglip+7b"
55
  # python3 -m interactive_demo --port 40000 --model_id prism-dinosiglip+7b &
56
-
57
  COMPONENT="interactive_demo"
58
- COMMAND=python3 -m $COMPONENT --port 40000 --model_id prism-dinosiglip+7
59
- READY_LOG="loaded prismatic prism-dinosiglip+7b"
60
-
61
- RUN_AND_WAIT $COMPONENT $COMMAND $READY_LOG
62
-
63
-
64
- # echo "Starting $COMPONENT"
65
- # nohup | tee "$COMPONENT.log" &
66
- # while [ `grep -c "loaded prismatic prism-dinosiglip+7b" "$COMPONENT.log"` -eq '0' ];do
67
- # sleep 1s;
68
- # echo "wait $COMPONENT to be running"
69
- # done
70
- # echo "$COMPONENT is running"
71
 
72
 
73
 
 
13
  print(f\"device count = {torch.cuda.device_count()}\"); \
14
  print(f\"current device = {torch.cuda.current_device()}\")"
15
 
16
+
17
+ COMPONENT="serve.controller"
18
+ echo "Starting $COMPONENT"
19
+ nohup python3 -m $COMPONENT --host 0.0.0.0 --port 10000 2>&1 | tee "$COMPONENT.log" &
20
+ while [ `grep -c "Uvicorn running on" "$COMPONENT.log"` -eq '0' ];do
21
+ sleep 1s;
22
+ echo "wait $COMPONENT to be running"
23
+ done
24
+ echo "$COMPONENT is running"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
 
26
 
27
  # sleep 30
 
34
 
35
  # echo "Starting prism-dinosiglip+7b"
36
  # python3 -m interactive_demo --port 40000 --model_id prism-dinosiglip+7b &
 
37
  COMPONENT="interactive_demo"
38
+ echo "Starting $COMPONENT"
39
+ nohup python3 -m $COMPONENT --port 40000 --model_id prism-dinosiglip+7 | tee "$COMPONENT.log" &
40
+ while [ `grep -c "loaded prismatic prism-dinosiglip+7b" "$COMPONENT.log"` -eq '0' ];do
41
+ sleep 1s;
42
+ echo "wait $COMPONENT to be running"
43
+ done
44
+ echo "$COMPONENT is running"
 
 
 
 
 
 
45
 
46
 
47