diazcalvi commited on
Commit
e8d0db3
1 Parent(s): cf4b8d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,10 +38,10 @@ def initialize_index(index_name, documents_folder):
38
 
39
  service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor)
40
  if os.path.exists(index_name):
41
- index = GPTSimpleVectorIndex.load_from_disk(index_name, service_context=service_context)
42
  else:
43
  documents = SimpleDirectoryReader(documents_folder).load_data()
44
- index = GPTSimpleVectorIndex.from_documents(documents, service_context=service_context)
45
  index.save_to_disk(index_name)
46
  print(DATA_FILE)
47
  index.save_to_disk(DATA_FILE)
 
38
 
39
  service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor)
40
  if os.path.exists(index_name):
41
+ index = GPTSimpleVectorIndex.load_from_disk(index_name)
42
  else:
43
  documents = SimpleDirectoryReader(documents_folder).load_data()
44
+ index = GPTSimpleVectorIndex.from_documents(documents)
45
  index.save_to_disk(index_name)
46
  print(DATA_FILE)
47
  index.save_to_disk(DATA_FILE)