Download server_debug.py from VishwaK03/Error-Driven-Learning-Reinforcement-Engine: direct link, hf CLI and curl.
- Browser
- Download file 613 Bytes
-
https://huggingface.co/spaces/VishwaK03/Error-Driven-Learning-Reinforcement-Engine/resolve/main/server_debug.py
- Command line
-
hf download hf://spaces/VishwaK03/Error-Driven-Learning-Reinforcement-Engine/server_debug.py
-
curl -L -o server_debug.py https://huggingface.co/spaces/VishwaK03/Error-Driven-Learning-Reinforcement-Engine/resolve/main/server_debug.py
613 Bytes
| print("--- [1] STARTING SERVER SCRIPT ---") | |
| from fastapi import FastAPI | |
| from pydantic import BaseModel | |
| import uvicorn | |
| print("--- [2] IMPORTS COMPLETE ---") | |
| app = FastAPI() | |
| def home(): | |
| return {"status": "Debug Server Running"} | |
| def predict(data: dict): | |
| print("Received request!") | |
| return { | |
| "error_type": "Test Error", | |
| "confidence": 99.9, | |
| "recommendation": "Connection Successful!" | |
| } | |
| print("--- [3] APP DEFINED. READY TO RUN. ---") | |
| if __name__ == "__main__": | |
| uvicorn.run(app, host="127.0.0.1", port=8000) |