File size: 401 Bytes
67a8e2a
 
 
 
 
 
 
1c65feb
67a8e2a
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader
from pathlib import Path
from llama_index import download_loader
import os



os.environ["OPENAI_API_KEY"] = "REPLACE"


PandasCSVReader = download_loader("PandasCSVReader")

loader = PandasCSVReader()
documents = loader.load_data(file=Path('./input.csv'))

index = GPTSimpleVectorIndex(documents)
index.save_to_disk('./output.json')