File size: 419 Bytes
91532c2
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from llama_index import GPTSimpleVectorIndex, SimpleDirectoryReader
from pathlib import Path
from llama_index import download_loader
import os



os.environ["OPENAI_API_KEY"] = "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"


documents = SimpleDirectoryReader('/Users/satya/Downloads/temp').load_data()

index = GPTSimpleVectorIndex.from_documents(documents)
index.save_to_disk('/Users/satya/Downloads/out.json')