Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: qdrant-client version>=1.9.2 is not supported in RAG agents #2985

Closed
thinkall opened this issue Jun 21, 2024 · 7 comments · Fixed by #3064
Closed

[Bug]: qdrant-client version>=1.9.2 is not supported in RAG agents #2985

thinkall opened this issue Jun 21, 2024 · 7 comments · Fixed by #3064
Labels
rag retrieve-augmented generative agents

Comments

@thinkall
Copy link
Collaborator

thinkall commented Jun 21, 2024

Describe the bug

Qdrant test/agentchat/contrib/retrievechat/test_qdrant_retrievechat.py::test_qdrant_filter started failing as qdrant-client released a new version 1.9.2.

Steps to reproduce

No response

Model Used

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

______________________________ test_qdrant_filter ______________________________
    @pytest.mark.skipif(not QDRANT_INSTALLED, reason="qdrant_client is not installed")
    def test_qdrant_filter():
        client = QdrantClient(":memory:")
>       create_qdrant_from_dir(dir_path="./website/docs", client=client, collection_name="autogen-docs")
test/agentchat/contrib/retrievechat/test_qdrant_retrievechat.py:86: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py:2[32](https://github.com/microsoft/autogen/actions/runs/9609759183/job/26505996587?pr=2942#step:11:33): in create_qdrant_from_dir
    client.add(
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/qdrant_client/qdrant_fastembed.py:525: in add
    self.upload_points(
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/qdrant_client/qdrant_client.py:19[33](https://github.com/microsoft/autogen/actions/runs/9609759183/job/26505996587?pr=2942#step:11:34): in upload_points
    return self._client.upload_points(
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/qdrant_client/local/qdrant_local.py:722: in upload_points
    self._upload_points(collection_name, points)
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/qdrant_client/local/qdrant_local.py:737: in _upload_points
    [
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/qdrant_client/local/qdrant_local.py:737: in <listcomp>
    [
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/qdrant_client/qdrant_fastembed.py:[35](https://github.com/microsoft/autogen/actions/runs/9609759183/job/26505996587?pr=2942#step:11:36)0: in _points_iterator
    for idx, meta, (doc, vector), sparse_vector in zip(
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/qdrant_client/qdrant_fastembed.py:254: in _embed_documents
    for vector, doc in zip(vectors_iter, documents_b):
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/text/text_embedding_base.py:43: in passage_embed
    yield from self.embed(texts, **kwargs)
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/text/text_embedding.py:93: in embed
    yield from self.model.embed(documents, batch_size, parallel, **kwargs)
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/text/onnx_embedding.py:266: in embed
    yield from self._embed_documents(
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/common/onnx_model.py:1[36](https://github.com/microsoft/autogen/actions/runs/9609759183/job/26505996587?pr=2942#step:11:37): in _embed_documents
    for batch in pool.ordered_map(iter_batch(documents, batch_size), **params):
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/parallel_processor.py:125: in ordered_map
    for idx, item in self.semi_ordered_map(stream, *args, **kwargs):


...


Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/parallel_processor.py", line 52, in _worker
    worker = worker_class.start(**kwargs)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/common/onnx_model.py", line 157, in start
    return cls(
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/common/onnx_model.py", line 153, in __init__
    self.model = self.init_embedding(model_name, cache_dir)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/text/onnx_embedding.py", line 298, in init_embedding
    return OnnxTextEmbedding(model_name=model_name, cache_dir=cache_dir, threads=1)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/text/onnx_embedding.py", line 237, in __init__
    self.load_onnx_model(
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/common/onnx_model.py", line 79, in load_onnx_model
    self.tokenizer = load_tokenizer(model_dir=model_dir)
  File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/fastembed/common/models.py", line 34, in load_tokenizer
    tokenizer = Tokenizer.from_file(str(tokenizer_path))
Exception: EOF while parsing a value at line 8166 column 14
ERROR:root:[Errno 2] No such file or directory: 'None/fast-bge-small-en.tar.gz'
@thinkall thinkall added bug rag retrieve-augmented generative agents labels Jun 21, 2024
@thinkall
Copy link
Collaborator Author

@Anush008 would you like to fix this?

@Anush008
Copy link
Collaborator

Hi @thinkall. I will look into this. Thank you.

@Anush008
Copy link
Collaborator

Hi @thinkall. The test seems to work fine for me with

pytest test/agentchat/contrib/retrievechat/test_qdrant_retrievechat.py --skip-openai -s

Could you please retry?

@thinkall
Copy link
Collaborator Author

Hi @thinkall. The test seems to work fine for me with


pytest test/agentchat/contrib/retrievechat/test_qdrant_retrievechat.py --skip-openai -s

Could you please retry?

Hi @Anush008 , I pinned the version to 1.9.1 to bypass the error. But we need to support latest version 1.9.2, could you help on that? Thanks.

@Anush008
Copy link
Collaborator

Will do.

@Anush008
Copy link
Collaborator

Hi @thinkall.
Could you please run

pip install -U fastembed qdrant-client

qdrant-client uses fastembed to generate embeddings. It recently had a fix which could be related to this.
The test works fine with the latest versions for me.

@thinkall thinkall mentioned this issue Jul 2, 2024
3 tasks
@thinkall
Copy link
Collaborator Author

thinkall commented Jul 2, 2024

Hi @thinkall. Could you please run

pip install -U fastembed qdrant-client

qdrant-client uses fastembed to generate embeddings. It recently had a fix which could be related to this. The test works fine with the latest versions for me.

Thank you @Anush008 , I've tested that fastembed==0.2.7 has the issue. Updated the dependency of retrievechat-qdrant accordingly in #3064 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rag retrieve-augmented generative agents
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants