File size: 983 Bytes
87c3140
 
 
b8abf64
524a99c
 
 
b8abf64
87c3140
 
 
 
 
 
 
 
 
 
 
 
 
 
e91ac58
 
87c3140
e91ac58
 
 
b8abf64
e91ac58
87c3140
 
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
import streamlit.web.cli as stcli
import os, sys

# pip install protobuf==3.20.0
# pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117 nope
# pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118



def resolve_path(path):
    resolved_path = os.path.abspath(os.path.join(os.getcwd(), path))
    return resolved_path


if __name__ == "__main__":
    dir_home = os.path.dirname(__file__)

    # pip install protobuf==3.20.0

    sys.argv = [
        "streamlit",
        "run",
        resolve_path(os.path.join(dir_home,"app.py")),
        # resolve_path(os.path.join(dir_home,"vouchervision", "VoucherVision_GUI.py")),
        "--global.developmentMode=false",
        # "--server.port=8545",
        "--server.port=8546",
        # Toggle below for HF vs Local
        # "--is_hf=1",
        # "--is_hf=0",
    ]
    sys.exit(stcli.main())