Spaces:
Running
Running
Download main.py from reputeradar/ioc-core: direct link, hf CLI and curl.
- Browser
- Download file 583 Bytes
-
https://huggingface.co/spaces/reputeradar/ioc-core/resolve/main/main.py
- Command line
-
hf download hf://spaces/reputeradar/ioc-core/main.py
-
curl -L -o main.py https://huggingface.co/spaces/reputeradar/ioc-core/resolve/main/main.py
583 Bytes
| """ | |
| IOC Core API - Main entry point. | |
| This module provides the entry point for running the application. | |
| The application logic is implemented in the src package. | |
| """ | |
| import os | |
| from src.app import app | |
| if __name__ == "__main__": | |
| import uvicorn | |
| workers = int(os.getenv("WORKERS", "1")) | |
| reload = os.getenv("RELOAD", "false").lower() == "true" | |
| # Note: workers > 1 is not compatible with reload | |
| if reload: | |
| uvicorn.run("main:app", host="0.0.0.0", port=7860, reload=True) | |
| else: | |
| uvicorn.run("main:app", host="0.0.0.0", port=7860, workers=workers) | |