mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
14 lines
445 B
Python
14 lines
445 B
Python
|
from langchain.document_loaders import CSVLoader
|
||
|
from langchain.tools.retriever import create_retriever_tool
|
||
|
from langchain.indexes import VectorstoreIndexCreator
|
||
|
from langchain.vectorstores import FAISS
|
||
|
|
||
|
loader = CSVLoader('/Users/harrisonchase/Downloads/titanic.csv')
|
||
|
|
||
|
docs = loader.load()
|
||
|
index_creator = VectorstoreIndexCreator(vectorstore_cls=FAISS)
|
||
|
|
||
|
index = index_creator.from_documents(docs)
|
||
|
|
||
|
index.vectorstore.save_local("titanic_data")
|