Spaces:
Running
Running
Update agent.py
Browse files
agent.py
CHANGED
@@ -221,11 +221,12 @@ for task in tasks:
|
|
221 |
# Initialize HuggingFace Embedding model
|
222 |
embedding_model = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
|
223 |
|
224 |
-
# Create FAISS VectorStore from documents
|
225 |
-
vector_store = FAISS.from_documents(docs, embedding_model)
|
226 |
-
#vector_store = FAISS.load_local("faiss_index", embedding_model)
|
227 |
|
228 |
-
|
|
|
|
|
|
|
|
|
229 |
vector_store.save_local("faiss_index")
|
230 |
|
231 |
|
|
|
221 |
# Initialize HuggingFace Embedding model
|
222 |
embedding_model = HuggingFaceEmbeddings(model_name="sentence-transformers/all-mpnet-base-v2")
|
223 |
|
|
|
|
|
|
|
224 |
|
225 |
+
from langchain_community.document_loaders import WikipediaLoader
|
226 |
+
|
227 |
+
wiki_docs = WikipediaLoader(query="Mercedes Sosa", load_max_docs=3).load()
|
228 |
+
all_docs = docs + wiki_docs # `docs` is your existing list
|
229 |
+
vector_store = FAISS.from_documents(all_docs, embedding_model)
|
230 |
vector_store.save_local("faiss_index")
|
231 |
|
232 |
|