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"