wt002 commited on
Commit
780b575
·
verified ·
1 Parent(s): 4a5b7c8

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +5 -4
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
- # Save the FAISS index locally
 
 
 
 
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