Spaces:
Runtime error
Runtime error
File size: 334 Bytes
1beff3e 643a4d6 d1bbc1c 643a4d6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# backend.py (in root of Space repo)
from fastapi import FastAPI
from pydantic import BaseModel
from qabot import llm_chain
#cheese
app = FastAPI()
class Query(BaseModel):
query: str
@app.post("/ask")
def ask_question(query: Query):
result = llm_chain.invoke({"query": query.query})
return {"answer": result["result"]}
|