Download app.py from Muleex12/backkend: direct link, hf CLI and curl.
- Browser
- Download file 350 Bytes
-
https://huggingface.co/spaces/Muleex12/backkend/resolve/main/app.py
- Command line
-
hf download hf://spaces/Muleex12/backkend/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Muleex12/backkend/resolve/main/app.py
350 Bytes
| from fastapi import FastAPI | |
| import uvicorn | |
| app = FastAPI() | |
| def home(): | |
| return {"message": "Backend is running"} | |
| def predict(data: dict): | |
| weight = data.get("weight") | |
| mpg = data.get("mpg") | |
| # dummy prediction (we will replace later) | |
| result = weight + mpg | |
| return {"prediction": result} | |