Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -20,8 +20,7 @@ def construct_index(directory_path):
|
|
20 |
|
21 |
documents = SimpleDirectoryReader(directory_path).load_data()
|
22 |
|
23 |
-
index = GPTSimpleVectorIndex(documents
|
24 |
-
|
25 |
index.save_to_disk('index.json')
|
26 |
|
27 |
return index
|
|
|
20 |
|
21 |
documents = SimpleDirectoryReader(directory_path).load_data()
|
22 |
|
23 |
+
index = GPTSimpleVectorIndex.from_documents(documents)
|
|
|
24 |
index.save_to_disk('index.json')
|
25 |
|
26 |
return index
|