You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use map_batches update the database obtained by langchain FAISS, but I can not get correct answer.
Is it because the distributed approach is not suitable for this kind of update ?
fromlangchain.vectorstoresimportFAISSdb=FAISS.from_texts(["start"],embedding_model)
defupdate_db(batch):
globaldbdb.add_texts(batch['text'])
# log the db print(len(db.docstore._dict)) # 2return {}
demo_data.map_batches(
update_db,
batch_size=10,
compute=ActorPoolStrategy(size=1)).count()
print("-----")
print(len(db.docstore._dict)) # 1
The text was updated successfully, but these errors were encountered:
I want to use map_batches update the database obtained by langchain FAISS, but I can not get correct answer.
Is it because the distributed approach is not suitable for this kind of update ?
The text was updated successfully, but these errors were encountered: