Spaces:
Sleeping
Sleeping
Download app.py from refaelz/legacy-code-challenge: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/spaces/refaelz/legacy-code-challenge/resolve/main/app.py
- Command line
-
hf download hf://spaces/refaelz/legacy-code-challenge/app.py
-
curl -L -o app.py https://huggingface.co/spaces/refaelz/legacy-code-challenge/resolve/main/app.py
1.28 kB
| """ | |
| app.py β Entry point using minimal_test.py (Tabs-based navigation) | |
| This version uses Tabs instead of Columns for better production compatibility. | |
| """ | |
| import os | |
| import sys | |
| import logging | |
| from dotenv import load_dotenv | |
| # Configure logging | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format='%(asctime)s [%(levelname)s] %(name)s: %(message)s', | |
| handlers=[ | |
| logging.FileHandler('app.log', encoding='utf-8'), | |
| logging.StreamHandler(sys.stdout) | |
| ] | |
| ) | |
| logger = logging.getLogger(__name__) | |
| # Load .env if it exists | |
| load_dotenv() | |
| # Apply proxy settings | |
| if os.getenv("http_proxy"): | |
| os.environ["http_proxy"] = os.getenv("http_proxy") | |
| if os.getenv("https_proxy"): | |
| os.environ["https_proxy"] = os.getenv("https_proxy") | |
| if os.getenv("no_proxy"): | |
| os.environ["no_proxy"] = os.getenv("no_proxy") | |
| logger.info("π Launching Legacy Code Challenge (Original version)...") | |
| import student_interface | |
| demo = student_interface.demo | |
| logger.info("β Demo imported successfully!") | |
| if __name__ == "__main__": | |
| logger.info("π Launching application...") | |
| # On HuggingFace Spaces, Gradio handles server config automatically | |
| demo.launch( | |
| show_error=True, | |
| css=student_interface._CSS, | |
| js=student_interface._JS, | |
| ) | |