Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
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)
|
|
|
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)
|