Spaces:
Sleeping
Sleeping
Download server/app.py from hackrock18/cloud-data-janitor: direct link, hf CLI and curl.
- Browser
- Download file 673 Bytes
-
https://huggingface.co/spaces/hackrock18/cloud-data-janitor/resolve/main/server/app.py
- Command line
-
hf download hf://spaces/hackrock18/cloud-data-janitor/server/app.py
-
curl -L -o app.py https://huggingface.co/spaces/hackrock18/cloud-data-janitor/resolve/main/server/app.py
673 Bytes
| from fastapi import FastAPI | |
| from environment.cloud_env import CloudDataJanitorEnv | |
| import uvicorn | |
| app = FastAPI() | |
| env = CloudDataJanitorEnv(task_name="easy") | |
| def read_root(): | |
| # This is the endpoint Hugging Face pings to check if you are alive! | |
| return {"status": "ok", "message": "Cloud Data Janitor is running"} | |
| def reset_env(): | |
| state = env.reset() | |
| return {"status": "ok", "state": state} | |
| # --- Bottom of server/app.py --- | |
| # Rename 'run' to 'main' | |
| def main(): | |
| import uvicorn | |
| uvicorn.run("server.app:app", host="0.0.0.0", port=7860) | |
| # Add the standard Python callable block | |
| if __name__ == "__main__": | |
| main() |