Spaces:
Runtime error
Runtime error
Download run.py from Expanded-Repetition/ammo-card: direct link, hf CLI and curl.
- Browser
- Download file 811 Bytes
-
https://huggingface.co/spaces/Expanded-Repetition/ammo-card/resolve/main/run.py
- Command line
-
hf download hf://spaces/Expanded-Repetition/ammo-card/run.py
-
curl -L -o run.py https://huggingface.co/spaces/Expanded-Repetition/ammo-card/resolve/main/run.py
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() | |