Update Components/GooglePalmChat.py
Browse files
Components/GooglePalmChat.py
CHANGED
@@ -2,7 +2,8 @@ import os
|
|
2 |
from dotenv import load_dotenv
|
3 |
from langchain_google_genai import GoogleGenerativeAI
|
4 |
from langchain.chains import RetrievalQA
|
5 |
-
from langchain.vectorstores import FAISS
|
|
|
6 |
from langchain.prompts import PromptTemplate
|
7 |
|
8 |
load_dotenv() # take environment variables from .env (especially openai api key)
|
@@ -14,7 +15,7 @@ vectordb_file_path = "faiss_index_V2"
|
|
14 |
|
15 |
def get_qa_chain(embeddings):
|
16 |
# Load the vector database from the local folder
|
17 |
-
vectordb = FAISS.load_local(vectordb_file_path, embeddings)
|
18 |
|
19 |
# Create a retriever for querying the vector database
|
20 |
retriever = vectordb.as_retriever(score_threshold=0.7)
|
|
|
2 |
from dotenv import load_dotenv
|
3 |
from langchain_google_genai import GoogleGenerativeAI
|
4 |
from langchain.chains import RetrievalQA
|
5 |
+
# from langchain.vectorstores import FAISS
|
6 |
+
from langchain_community.vectorstores import FAISS
|
7 |
from langchain.prompts import PromptTemplate
|
8 |
|
9 |
load_dotenv() # take environment variables from .env (especially openai api key)
|
|
|
15 |
|
16 |
def get_qa_chain(embeddings):
|
17 |
# Load the vector database from the local folder
|
18 |
+
vectordb = FAISS.load_local(vectordb_file_path, embeddings,allow_dangerous_deserialization=True)
|
19 |
|
20 |
# Create a retriever for querying the vector database
|
21 |
retriever = vectordb.as_retriever(score_threshold=0.7)
|