Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,7 +51,7 @@ def construct_index(doc):
|
|
| 51 |
|
| 52 |
# save index to disk
|
| 53 |
index.set_index_id("vector_index")
|
| 54 |
-
index.storage_context.persist('/
|
| 55 |
|
| 56 |
return index
|
| 57 |
|
|
@@ -77,10 +77,10 @@ def ask_ai(doc, question):
|
|
| 77 |
index = construct_index([Document(text)])
|
| 78 |
|
| 79 |
# Save index to Azure blob storage
|
| 80 |
-
index.storage_context.persist(f'
|
| 81 |
|
| 82 |
# Rebuild storage context
|
| 83 |
-
storage_context = StorageContext.from_defaults(persist_dir=f'
|
| 84 |
|
| 85 |
# Load index
|
| 86 |
index = load_index_from_storage(storage_context)
|
|
|
|
| 51 |
|
| 52 |
# save index to disk
|
| 53 |
index.set_index_id("vector_index")
|
| 54 |
+
index.storage_context.persist('/gpttest')
|
| 55 |
|
| 56 |
return index
|
| 57 |
|
|
|
|
| 77 |
index = construct_index([Document(text)])
|
| 78 |
|
| 79 |
# Save index to Azure blob storage
|
| 80 |
+
index.storage_context.persist(f'gpttest/{file_name}', fs=fs)
|
| 81 |
|
| 82 |
# Rebuild storage context
|
| 83 |
+
storage_context = StorageContext.from_defaults(persist_dir=f'gpttest/{file_name}')
|
| 84 |
|
| 85 |
# Load index
|
| 86 |
index = load_index_from_storage(storage_context)
|