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]: hybrid_search pymilvus.exceptions.MilvusException: <MilvusException: (code=1, message=Unexpected error, message=<required argument is not a float>)> #38529

Open
1 task done
DotaArtist opened this issue Dec 17, 2024 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@DotaArtist
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version:
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

self.index_client = MilvusClient(uri=self.url, token=self.token, user=self.user, password=self.password, db_name=self.db_name)
search_param_1 = {
"data": [query_embedding_dict["dense_vecs"]],
"anns_field": "title_vector", "param": {"metric_type": "COSINE"},
"limit": 3, "expr": "bot_name == {}".format(bot_name)
}
request_1 = AnnSearchRequest(**search_param_1)

query_sparse_vector = {10: 0.3}, {20: 0.2}

search_param_2 = {
"data": [query_embedding_dict["lexical_weights"]],
"anns_field": "title_sparse_vector", "param": {"metric_type": "COSINE", "params": {"drop_ratio_build": 0.2}},
"limit": 3, "expr": "bot_name == {}".format(bot_name)
}
request_2 = AnnSearchRequest(**search_param_2)

reqs = [request_1, request_2]
response_array = self.index_client.hybrid_search(
collection_name=collection_name, reqs=reqs,
output_fields=self.output_fields,
ranker=RRFRanker(k=60), limit=search_top_k)

res = conn.hybrid_search(
      ^^^^^^^^^^^^^^^^^^^

File "/mnt/ceph01/peng.yu/DS/llmparty/.conda/lib/python3.11/site-packages/pymilvus/decorators.py", line 164, in handler
raise MilvusException(message=f"Unexpected error, message=<{e!s}>") from e
pymilvus.exceptions.MilvusException: <MilvusException: (code=1, message=Unexpected error, message=)>

Expected Behavior

No response

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

@DotaArtist DotaArtist added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 17, 2024
@xiaofan-luan
Copy link
Collaborator

  1. Sparse vector only support IP distance metric
  2. I thought the sparse vector format is incorrect, but the current error message is not clear. I guess you should print
    query_embedding_dict["dense_vecs"]
    query_embedding_dict["lexical_weights"]

and see if it's a valid input

@yanliang567
Copy link
Contributor

/assign @DotaArtist
/unassign

@yanliang567 yanliang567 added help wanted Extra attention is needed and removed kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants