Spaces:
Build error
Build error
Download run_api.py from empirenexus/OpenNotebook: direct link, hf CLI and curl.
- Browser
- Download file 754 Bytes
-
https://huggingface.co/spaces/empirenexus/OpenNotebook/resolve/main/run_api.py
- Command line
-
hf download hf://spaces/empirenexus/OpenNotebook/run_api.py
-
curl -L -o run_api.py https://huggingface.co/spaces/empirenexus/OpenNotebook/resolve/main/run_api.py
754 Bytes
| #!/usr/bin/env python3 | |
| """ | |
| Startup script for Open Notebook API server. | |
| """ | |
| import os | |
| import sys | |
| from pathlib import Path | |
| import uvicorn | |
| # Add the current directory to Python path so imports work | |
| current_dir = Path(__file__).parent | |
| sys.path.insert(0, str(current_dir)) | |
| if __name__ == "__main__": | |
| # Default configuration | |
| host = os.getenv("API_HOST", "127.0.0.1") | |
| port = int(os.getenv("API_PORT", "5055")) | |
| reload = os.getenv("API_RELOAD", "true").lower() == "true" | |
| print(f"Starting Open Notebook API server on {host}:{port}") | |
| print(f"Reload mode: {reload}") | |
| uvicorn.run( | |
| "api.main:app", | |
| host=host, | |
| port=port, | |
| reload=reload, | |
| reload_dirs=[str(current_dir)] if reload else None, | |
| ) | |