File size: 495 Bytes
9d4ad59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

cd /workspace

# Spot Instance vs
if dpkg-query -W libgl1 2>/dev/null | grep -q "libgl1"; then
  echo -n ""
else
  echo "libgl1 is not installed. Installing..."
  apt update
  apt install -yq libgl1
fi

python /workspace/SD/launch.py --port 7860 --api --theme dark --allow-code --enable-insecure-extension-access --listen --share --cuda-malloc --cuda-stream --pin-shared-memory

kill $!
kill -9 $(ps -ef | grep 'ngrok' | grep -v 'grep' | awk '{print $2}')
deactivate
echo "stopped"