Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ from langchain.schema import Document
|
|
9 |
from langchain_community.llms import HuggingFaceHub
|
10 |
from langchain.chains import RetrievalQA, LLMChain
|
11 |
from langchain.prompts import PromptTemplate
|
12 |
-
from langchain_community.embeddings import
|
13 |
from langchain_community.vectorstores import Chroma
|
14 |
from langchain.retrievers import ContextualCompressionRetriever
|
15 |
from langchain.retrievers.document_compressors import LLMChainExtractor
|
@@ -69,7 +69,7 @@ def setup_advanced_rag_pipeline(model_name):
|
|
69 |
splits = load_and_process_documents("index_training.json") # Replace with your document path
|
70 |
|
71 |
# Set up InstructorEmbeddings
|
72 |
-
embeddings =
|
73 |
|
74 |
# Create vectorstore
|
75 |
vectorstore = Chroma.from_documents(documents=splits, embedding=embeddings)
|
|
|
9 |
from langchain_community.llms import HuggingFaceHub
|
10 |
from langchain.chains import RetrievalQA, LLMChain
|
11 |
from langchain.prompts import PromptTemplate
|
12 |
+
from langchain_community.embeddings import HuggingFaceEmbeddings
|
13 |
from langchain_community.vectorstores import Chroma
|
14 |
from langchain.retrievers import ContextualCompressionRetriever
|
15 |
from langchain.retrievers.document_compressors import LLMChainExtractor
|
|
|
69 |
splits = load_and_process_documents("index_training.json") # Replace with your document path
|
70 |
|
71 |
# Set up InstructorEmbeddings
|
72 |
+
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
73 |
|
74 |
# Create vectorstore
|
75 |
vectorstore = Chroma.from_documents(documents=splits, embedding=embeddings)
|