File size: 616 Bytes
bf62248
 
08cbd06
bf62248
 
 
 
 
 
 
 
 
 
 
 
08cbd06
 
 
 
 
bf62248
 
 
 
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
import argparse
from copaint.gradio_ui import build_gradio_ui
import os

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-s", "--share",
        action=argparse.BooleanOptionalAction,  # enables --share / --no-share
        default=True,
        help="Share the app publicly (default: true)"
    )
    args = parser.parse_args()

    demo = build_gradio_ui()
    # check if /dev/shm exists
    if os.path.exists("/dev/shm"):
        demo.launch(share=args.share, allowed_paths=["/dev/shm"])
    else:
        demo.launch(share=args.share)


if __name__ == "__main__":
    main()