Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -110,6 +110,12 @@ def ask_ai_upload(doc, question):
|
|
| 110 |
|
| 111 |
text, file_name = extract_text(doc)
|
| 112 |
index = construct_index([Document(text)])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
# Save index to Azure blob storage
|
| 115 |
index.storage_context.persist(f'gpt/storage_demo/{file_name}', fs=fs)
|
|
|
|
| 110 |
|
| 111 |
text, file_name = extract_text(doc)
|
| 112 |
index = construct_index([Document(text)])
|
| 113 |
+
index2 = index
|
| 114 |
+
index2.storage_context.persist(f'{file_name}')
|
| 115 |
+
storage_context2 = StorageContext.from_defaults(persist_dir=f'{file_name}')
|
| 116 |
+
|
| 117 |
+
# Load index
|
| 118 |
+
index2 = load_index_from_storage(storage_context2)
|
| 119 |
|
| 120 |
# Save index to Azure blob storage
|
| 121 |
index.storage_context.persist(f'gpt/storage_demo/{file_name}', fs=fs)
|