Spaces:
Sleeping
Sleeping
Download server/app.py from saiteja020/EnergyStock: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/spaces/saiteja020/EnergyStock/resolve/main/server/app.py
- Command line
-
hf download hf://spaces/saiteja020/EnergyStock/server/app.py
-
curl -L -o app.py https://huggingface.co/spaces/saiteja020/EnergyStock/resolve/main/server/app.py
469 Bytes
| import os | |
| import sys | |
| _ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) | |
| if _ROOT not in sys.path: | |
| sys.path.insert(0, _ROOT) | |
| def main(): | |
| import uvicorn | |
| # Important: OpenEnv validation requires starting the uvicorn hook through main() block | |
| uvicorn.run( | |
| "app:app", | |
| host="0.0.0.0", | |
| port=int(os.getenv("PORT", 7860)), | |
| reload=False, | |
| log_level="info", | |
| ) | |
| if __name__ == "__main__": | |
| main() | |