Find answers from the community

Updated 2 years ago

Loading weaviate

Plain Text
from llama_index import StorageContextload_index_from_storage
from llama_index.readers import WeaviateReader
from llama_index.vector_stores import WeaviateVectorStore

documents = SimpleDirectoryReader('test_doc').load_data()

storage_context = StorageContext.from_dict()

TypeError: StorageContext.from_dict() missing 1 required positional argument: 'save_dict'


i want to use weaviate vector store.

Plain Text
storage_context = StorageContext.from_dict(
     vector_store=WeaviateVectorStore(weaviate_client=weaviate_client),
)

Then i got an error
TypeError: StorageContext.from_dict() got an unexpected keyword argument 'vector_store'

If i use 'from_defaults' instead of 'from_dict' and weaviate vector store and trying to save in dict by using to_dict(). Then got value error

Plain Text
storage_context = StorageContext.from_defaults(
     vector_store=WeaviateVectorStore(weaviate_client=weaviate_client),
)

index = GPTVectorStoreIndex.from_documents(documents, storage_context=storage_context,service_context=service_context)
index.storage_context.to_dict()

ValueError: to_dict only available when using simple doc/index/vector stores


In previous versions of llama_index, we have save_to_disk, save_to_dict and save_to_string and similarly load from methods. Do we have save and load indices methods except load index persist in new version?
L
1 comment
All the information should be persisted on weaviate (I think!)

You can load an existing index from weaviate by setting up the storage context again and passing it in

index = GPTVectorStoreIndex([], storage_context=storage_context)
Add a reply
Sign up and join the conversation on Discord