Spaces:
Sleeping
Sleeping
File size: 581 Bytes
b525680 48e3a09 c3b26f1 48e3a09 e10380a 8eddf3d cf69b57 5b06e10 6472aaf d9f2cb7 2a81f6f dfd2a32 cf69b57 48e3a09 8542b1b dfd2a32 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | from fastapi import FastAPI, Query
import resultview as rv
import uvicorn
import json
app = FastAPI()
@app.post("/predict/")
async def predict(id:str):
try:
print(f"Request received {id}")
tenant_list = rv.algo_start(int(id))
print(f"List of tenants {tenant_list}")
return tenant_list
except Exception as error:
return {"prediction" : error}
if __name__ =="__main__":
uvicorn.run(app,host = "0.0.0.0", port=7860)
# ASI HAREMOS LLAMADAS A LA API $ curl -X POST "https://luismidv-mlsystemtfg.hf.space/predict/?id=1"
|