Spaces:
Runtime error

File size: 811 Bytes
2b4b6d8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from __future__ import annotations

import getpass
import os

from amo.app import build_app


def main():
    user = (os.environ.get("AMO_APP_USER") or "amo").strip() or "amo"
    password = os.environ.get("AMO_APP_PASSWORD", "")
    if len(password) < 12:
        print("This Gradio link will be public. Set a private login password before launching.")
        password = getpass.getpass("Set Amo web password (minimum 12 characters): ")
    if len(password) < 12:
        raise SystemExit("Password must be at least 12 characters. No app was launched.")
    demo = build_app()
    share = os.environ.get("AMO_SHARE", "false").lower() in {"1", "true", "yes"}
    demo.launch(share=share, auth=(user, password), show_error=True, theme=demo._amo_theme, css=demo._amo_css)


if __name__ == "__main__":
    main()