Update app.py
Browse files
app.py
CHANGED
|
@@ -7,8 +7,12 @@ from llama_index.core import StorageContext, load_index_from_storage
|
|
| 7 |
from vdb import further_retrieve, split_markdown_by_section, build_documents, create_vector_index, completion
|
| 8 |
import re
|
| 9 |
|
| 10 |
-
storage_context = StorageContext.from_defaults(persist_dir=f'./md_vector_store')
|
| 11 |
-
index = load_index_from_storage(storage_context)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
dotenv.load_dotenv()
|
| 14 |
|
|
|
|
| 7 |
from vdb import further_retrieve, split_markdown_by_section, build_documents, create_vector_index, completion
|
| 8 |
import re
|
| 9 |
|
| 10 |
+
# storage_context = StorageContext.from_defaults(persist_dir=f'./md_vector_store')
|
| 11 |
+
# index = load_index_from_storage(storage_context)
|
| 12 |
+
|
| 13 |
+
sections = split_markdown_by_section(md_file)
|
| 14 |
+
docs = build_documents(sections)
|
| 15 |
+
index = create_vector_index(docs)
|
| 16 |
|
| 17 |
dotenv.load_dotenv()
|
| 18 |
|