Spaces:
Runtime error

ammo-card / run.py
Expanded-Repetition's picture
Upload 17 files
2b4b6d8 verified
Raw History Blame Contribute Delete
811 Bytes
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()