This worked for me
from llama_index.core import StorageContext, load_index_from_storage
from llama_index.core.indices import MultiModalVectorStoreIndex
from llama_index.vector_stores.qdrant import QdrantVectorStore
import qdrant_client
client = qdrant_client.QdrantClient(host="localhost", port=6333)
text_store = QdrantVectorStore(
"text_collection", client=client
)
image_store = QdrantVectorStore(
"image_collection", client=client
)
storage_context = StorageContext.from_defaults(
vector_store=text_store, image_store=image_store
)
index = MultiModalVectorStoreIndex.from_documents(
<documents>,
storage_context=storage_context
)
nodes = index.as_retriever().retrieve("test")
print(len(nodes))
index.storage_context.persist(persist_dir="./storage")
text_store = QdrantVectorStore(
"text_collection", client=client
)
image_store = QdrantVectorStore(
"image_collection", client=client
)
loaded_storage_context = StorageContext.from_defaults(
persist_dir="./storage", vector_store=text_store, image_store=image_store
)
index = load_index_from_storage(loaded_storage_context)
nodes = index.as_retriever().retrieve("test")
print(len(nodes))