Spaces:
Sleeping
Sleeping
Update langchain_helper.py
Browse files- langchain_helper.py +2 -2
langchain_helper.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from langchain.vectorstores import FAISS
|
2 |
from langchain.llms import GooglePalm
|
3 |
from langchain.document_loaders.csv_loader import CSVLoader
|
4 |
-
from
|
5 |
from langchain.prompts import PromptTemplate
|
6 |
from langchain.chains import RetrievalQA
|
7 |
import os
|
@@ -12,7 +12,7 @@ load_dotenv() # take environment variables from .env (especially openai api key
|
|
12 |
# Create Google Palm LLM model
|
13 |
llm = GooglePalm(google_api_key=os.environ["GOOGLE_API_KEY"], temperature=0.1)
|
14 |
# # Initialize instructor embeddings using the Hugging Face model
|
15 |
-
instructor_embeddings =
|
16 |
vectordb_file_path = "faiss_index"
|
17 |
|
18 |
def create_vector_db():
|
|
|
1 |
from langchain.vectorstores import FAISS
|
2 |
from langchain.llms import GooglePalm
|
3 |
from langchain.document_loaders.csv_loader import CSVLoader
|
4 |
+
from langchain_community.embeddings import HuggingFaceEmbeddings
|
5 |
from langchain.prompts import PromptTemplate
|
6 |
from langchain.chains import RetrievalQA
|
7 |
import os
|
|
|
12 |
# Create Google Palm LLM model
|
13 |
llm = GooglePalm(google_api_key=os.environ["GOOGLE_API_KEY"], temperature=0.1)
|
14 |
# # Initialize instructor embeddings using the Hugging Face model
|
15 |
+
instructor_embeddings = HuggingFaceEmbeddings(model_name="hkunlp/instructor-large")
|
16 |
vectordb_file_path = "faiss_index"
|
17 |
|
18 |
def create_vector_db():
|