Find answers from the community

Updated 8 months ago

Legacy

Hi! I don't understand what am I doing wrong here:


Plain Text
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
from llama_index.core import SimpleDirectoryReader, StorageContext, VectorStoreIndex
from llama_index.legacy.vector_stores import QdrantVectorStore
from llama_index.core import Settings


Settings.embed_model = HuggingFaceEmbedding(model_name="embeddings/DeepPavlov_rubert-base-cased")

documents = SimpleDirectoryReader("./data/new/").load_data()

client = qdrant_client.QdrantClient(
    host="localhost",
    port=6333
)

vector_store = QdrantVectorStore(client=client, collection_name="data")
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(
    documents=documents,
    storage_context=storage_context
)


I'm getting:

Plain Text
  File "/home/ali/AI/nexus/iuth/venv/lib/python3.10/site-packages/llama_index/legacy/vector_stores/qdrant.py", line 188, in _build_points
    assert isinstance(node, BaseNode)
AssertionError


Might be some error with imports?
L
p
5 comments
Can't mix legacy with non-legacy imports
Use all legacy or no legacy
Yes, but the thing is:

In the tutorial, it says I need to import QdrantVectorStore from:

Plain Text
from llama_index.vector_stores.qdrant import QdrantVectorStore


but there is no vector_stores module in llama_index
Attachment
image.png
@Logan M My bad, I needed to pip install:

Plain Text
llama-index-vector-stores-qdrant
Add a reply
Sign up and join the conversation on Discord