Spaces:
Runtime error
Runtime error
Download src/modules/api/__init__.py from pnstack/template-python: direct link, hf CLI and curl.
- Browser
- Download file 432 Bytes
-
https://huggingface.co/spaces/pnstack/template-python/resolve/43909516e0cf3c8301074a335734d496399a54b9/src/modules/api/__init__.py
- Command line
-
hf download hf://spaces/pnstack/template-python@43909516e0cf3c8301074a335734d496399a54b9/src/modules/api/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/pnstack/template-python/resolve/43909516e0cf3c8301074a335734d496399a54b9/src/modules/api/__init__.py
432 Bytes
| import uvicorn | |
| from .app import app as api_app | |
| import logging | |
| async def server(): | |
| """Main application entry point.""" | |
| try: | |
| print("Start api...") | |
| config = uvicorn.Config(api_app, host="0.0.0.0", port=8080, log_level="info") | |
| server = uvicorn.Server(config) | |
| await server.serve() | |
| except Exception as e: | |
| logging.error(f"Application failed to start: {e}", exc_info=True) | |
| raise | |