Skip to content

Commit

Permalink
cr
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryjliu committed Aug 10, 2024
1 parent 7dbbc8b commit d9d39b8
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions examples/multimodal/multimodal_report_generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,6 @@
"print(text_nodes[10].get_content(metadata_mode=\"all\"))"
]
},
{
"cell_type": "markdown",
"id": "4f404f56-db1e-4ed7-9ba1-ead763546348",
"metadata": {},
"source": [
"#### Build Index\n",
"\n",
"Once the text nodes are ready, we feed into our vector store index abstraction, which will index these nodes into a simple in-memory vector store (of course, you should definitely check out our 40+ vector store integrations!)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -404,16 +394,14 @@
" load_index_from_storage,\n",
")\n",
"\n",
"if not os.path.exists(\"storage_nodes_tmp_summary\"):\n",
"if not os.path.exists(\"storage_nodes_summary\"):\n",
" index = SummaryIndex(text_nodes)\n",
" # save index to disk\n",
" index.set_index_id(\"summary_index\")\n",
" index.storage_context.persist(\"./storage_nodes_tmp_summary\")\n",
" index.storage_context.persist(\"./storage_nodes_summary\")\n",
"else:\n",
" # rebuild storage context\n",
" storage_context = StorageContext.from_defaults(\n",
" persist_dir=\"storage_nodes_tmp_summary\"\n",
" )\n",
" storage_context = StorageContext.from_defaults(persist_dir=\"storage_nodes_summary\")\n",
" # load index\n",
" index = load_index_from_storage(storage_context, index_id=\"summary_index\")"
]
Expand Down

0 comments on commit d9d39b8

Please sign in to comment.