Spaces:
Runtime error
Runtime error
Download app.py from StatsTech/StatsEasyApp: direct link, hf CLI and curl.
- Browser
- Download file 698 Bytes
-
https://huggingface.co/spaces/StatsTech/StatsEasyApp/resolve/main/app.py
- Command line
-
hf download hf://spaces/StatsTech/StatsEasyApp/app.py
-
curl -L -o app.py https://huggingface.co/spaces/StatsTech/StatsEasyApp/resolve/main/app.py
698 Bytes
| import gradio as gr | |
| import os | |
| # 1. This securely reads the token you just saved in the Space's settings. | |
| # The token itself is NOT in the code. | |
| hf_token = os.environ.get("HF_TOKEN") | |
| if not hf_token: | |
| raise ValueError("HF_TOKEN secret is not set. Please add it to your Space settings.") | |
| # 2. This uses your secret token to "unlock" and load your private Space. | |
| print(f"Attempting to load private Space: spaces/StatsTech/StatsEasy") | |
| demo = gr.load("spaces/StatsTech/StatsEasy", hf_token=hf_token) | |
| print("Private Space loaded successfully.") | |
| # 3. This launches the loaded app. | |
| demo.launch() | |
| import gradio as gr | |
| demo = gr.load("spaces/StatsTech/StatsEasy") | |
| demo.launch() | |