Spaces:
Sleeping
Sleeping
Update user_guide_sync.py
Browse files- user_guide_sync.py +5 -6
user_guide_sync.py
CHANGED
|
@@ -69,14 +69,13 @@ def get_base_links():
|
|
| 69 |
|
| 70 |
def update_user_guide():
|
| 71 |
get_base_links()
|
| 72 |
-
return "done"
|
| 73 |
# try:
|
| 74 |
# storage_context = StorageContext.from_defaults(persist_dir="llama_index")
|
| 75 |
# index = load_index_from_storage(storage_context=storage_context)
|
| 76 |
# print("loaded")
|
| 77 |
# except:
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
| 69 |
|
| 70 |
def update_user_guide():
|
| 71 |
get_base_links()
|
|
|
|
| 72 |
# try:
|
| 73 |
# storage_context = StorageContext.from_defaults(persist_dir="llama_index")
|
| 74 |
# index = load_index_from_storage(storage_context=storage_context)
|
| 75 |
# print("loaded")
|
| 76 |
# except:
|
| 77 |
+
documents = SimpleDirectoryReader("user_guide").load_data()
|
| 78 |
+
index = VectorStoreIndex.from_documents(documents)
|
| 79 |
+
index.storage_context.persist("llama_index")
|
| 80 |
+
print("index created")
|
| 81 |
+
return index
|