dhairyagorasiya's picture
Update app.py
2f5e266 verified
Raw History Blame Contribute Delete
383 Bytes
from fastapi import FastAPI
from inference import run
app = FastAPI()
@app.get("/")
def root():
return {"message": "API running"}
@app.post("/reset")
def reset():
return {"status": "reset successful"}
@app.post("/infer")
def infer():
try:
result = run()
return {"result": result}
except Exception as e:
return {"error": str(e)}