testhtml / app.py
timbosssds's picture
Update app.py
0d5e4b8 verified
Raw History Blame Contribute Delete
369 Bytes
from fastapi import FastAPI, Body
#from llm.model import predict
app = FastAPI()
@app.post("/index")
async def make_prediction(data: dict = Body(...)):
# Get user input from the request body
user_input = data["input"]
# Call the LLM model for prediction
output = predict(user_input)
# Return the prediction as JSON
return {"output": output}