Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from huggingface_hub import login
|
|
9 |
from typing import List, Dict, Any
|
10 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
11 |
from langchain.embeddings import HuggingFaceEmbeddings
|
12 |
-
from
|
13 |
|
14 |
app = FastAPI()
|
15 |
|
@@ -110,7 +110,7 @@ async def chat(request: ChatRequest):
|
|
110 |
# put back the unformatted user message
|
111 |
request.chat_history.append({"role": "user", "parts": [{"text": request.message}]})
|
112 |
|
113 |
-
return {"response": response.text, "dataset_str": concise_text_string[:75], "history": request.chat_history, "RAG_prompt":
|
114 |
|
115 |
if request.model_choice == "HF":
|
116 |
if hf_token:
|
|
|
9 |
from typing import List, Dict, Any
|
10 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
11 |
from langchain.embeddings import HuggingFaceEmbeddings
|
12 |
+
from langchain_community.vectorstores import FAISS
|
13 |
|
14 |
app = FastAPI()
|
15 |
|
|
|
110 |
# put back the unformatted user message
|
111 |
request.chat_history.append({"role": "user", "parts": [{"text": request.message}]})
|
112 |
|
113 |
+
return {"response": response.text, "dataset_str": concise_text_string[:75], "history": request.chat_history, "RAG_prompt": rag_prompt}
|
114 |
|
115 |
if request.model_choice == "HF":
|
116 |
if hf_token:
|