Spaces:
Sleeping
Sleeping
Update app/main.py
Browse files- app/main.py +3 -3
app/main.py
CHANGED
|
@@ -2,8 +2,8 @@ from fastapi import FastAPI, Request, Form
|
|
| 2 |
from fastapi.responses import HTMLResponse
|
| 3 |
from fastapi.staticfiles import StaticFiles
|
| 4 |
from fastapi.templating import Jinja2Templates
|
| 5 |
-
|
| 6 |
-
from app.rag import load_data, retrieve_chunks
|
| 7 |
|
| 8 |
app = FastAPI()
|
| 9 |
|
|
@@ -27,7 +27,7 @@ async def ask(request: Request, query: str = Form(...)):
|
|
| 27 |
context = "\n\n".join(retrieved)
|
| 28 |
|
| 29 |
# Ask the model
|
| 30 |
-
answer =
|
| 31 |
|
| 32 |
return templates.TemplateResponse(
|
| 33 |
"index.html",
|
|
|
|
| 2 |
from fastapi.responses import HTMLResponse
|
| 3 |
from fastapi.staticfiles import StaticFiles
|
| 4 |
from fastapi.templating import Jinja2Templates
|
| 5 |
+
from app.llm import generate_answer
|
| 6 |
+
from app.rag import load_data, retrieve_chunks
|
| 7 |
|
| 8 |
app = FastAPI()
|
| 9 |
|
|
|
|
| 27 |
context = "\n\n".join(retrieved)
|
| 28 |
|
| 29 |
# Ask the model
|
| 30 |
+
answer = generate_model(context, query)
|
| 31 |
|
| 32 |
return templates.TemplateResponse(
|
| 33 |
"index.html",
|