Closed LeopardCatCat closed 2 weeks ago
Hey @LeopardCatCat! 👋 I'm here to help you out with any bugs or questions you have. I can also guide you on how to become a contributor to this repository. Let's tackle this together while we wait for a human maintainer.
To resolve the ModuleNotFoundError: No module named 'llama_index.vector_stores.qdrant'
error, you need to install the qdrant-client
package. You can do this by running the following command:
pip install qdrant-client
Additionally, ensure that you are importing the correct module path in your code. The correct import statement should be:
from llama_index.vector_stores.qdrant import QdrantVectorStore
The QdrantVectorStore
class is located in the llama_index.vector_stores.qdrant.base
module and is re-exported in the llama_index.vector_stores.qdrant
package's __init__.py
file [1][2].
To continue talking to Dosu, mention @dosu.
Make sure its installed pip install llama-index-vector-stores-qdrant
(If you are in a notebook, restart it after installing)
Bug Description
when I run this code: from llama_index.core import SimpleDirectoryReader from llama_index.core.embeddings import BaseEmbedding from llama_index.core.extractors import SummaryExtractor from llama_index.core.ingestion import IngestionPipeline from llama_index.core.llms.llm import LLM from llama_index.core.vector_stores.types import BasePydanticVectorStore from llama_index.core.node_parser import SentenceSplitter from llama_index.core.schema import Document, MetadataMode from llama_index.vector_stores.qdrant import QdrantVectorStore
from llama_index.vector_stores.chroma.base import ChromaVectorStore
from qdrant_client import AsyncQdrantClient, models from qdrant_client.http.exceptions import UnexpectedResponse
from custom.template import SUMMARY_EXTRACT_TEMPLATE from custom.transformation import CustomFilePathExtractor, CustomTitleExtractor
def read_data(path: str = "data") -> list[Document]: reader = SimpleDirectoryReader( input_dir=path, recursive=True, required_exts=[ ".txt", ], ) return reader.load_data()
def build_pipeline( llm: LLM, embed_model: BaseEmbedding, template: str = None, vector_store: BasePydanticVectorStore = None, ) -> IngestionPipeline: transformation = [ SentenceSplitter(chunk_size=1024, chunk_overlap=50), CustomTitleExtractor(metadata_mode=MetadataMode.EMBED), CustomFilePathExtractor(last_path_length=4, metadata_mode=MetadataMode.EMBED),
SummaryExtractor(
async def build_vector_store( config: dict, reindex: bool = False ) -> tuple[AsyncQdrantClient, QdrantVectorStore]: client = AsyncQdrantClient(
url=config["QDRANT_URL"],
bug:(.venv) root@gpunode:/home/gpuadmin/aiops# /home/gpuadmin/aiops/.venv/bin/python /home/gpuadmin/aiops/aiops-demo/aiops24-RAG-demo-glm/demo/pipeline/ingestion.py Traceback (most recent call last): File "/home/gpuadmin/aiops/aiops-demo/aiops24-RAG-demo-glm/demo/pipeline/ingestion.py", line 9, in
from llama_index.vector_stores.qdrant import QdrantVectorStore
ModuleNotFoundError: No module named 'llama_index.vector_stores.qdrant'
Version
0.10.53
Steps to Reproduce
how to resolve it
Relevant Logs/Tracbacks
No response