MLSystemTFG / app.py
luismidv's picture
new
d9f2cb7
raw
history blame
604 Bytes
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}")
print("Check")
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"