You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RPC error: [search], <MilvusException: (code=1100, message=fail to search: metric type not match: invalid [expected=L2][actual=COSINE]: invalid parameter)>, <Time:{'RPC start': '2024-12-25 16:15:58.358832', 'RPC error': '2024-12-25 16:15:58.359751'}>
0%| | 0/1174 [00:01<?, ?it/s]
Traceback (most recent call last):
File "/home/wupeiyang/work/RTL-Repo/src/generate_data_for_rag_test_dynamic_langchain.py", line 405, in
main()
File "/home/wupeiyang/work/RTL-Repo/src/generate_data_for_rag_test_dynamic_langchain.py", line 306, in main
results = vector_store.similarity_search_with_score(prompt,param=search_params)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/langchain_milvus/vectorstores/milvus.py", line 1182, in similarity_search_with_score
res = self.similarity_search_with_score_by_vector(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/langchain_milvus/vectorstores/milvus.py", line 1221, in similarity_search_with_score_by_vector
col_search_res = self._collection_search(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/langchain_milvus/vectorstores/milvus.py", line 1047, in _collection_search
res = self.col.search(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/orm/collection.py", line 801, in search
resp = conn.search(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 141, in handler
raise e from e
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 137, in handler
return func(*args, **kwargs)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 176, in handler
return func(self, *args, **kwargs)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 116, in handler
raise e from e
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 86, in handler
return func(*args, **kwargs)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 805, in search
return self._execute_search(request, timeout, round_decimal=round_decimal, **kwargs)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 746, in _execute_search
raise e from e
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 735, in _execute_search
check_status(response.status)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/client/utils.py", line 63, in check_status
raise MilvusException(status.code, status.reason, status.error_code)
pymilvus.exceptions.MilvusException: <MilvusException: (code=1100, message=fail to search: metric type not match: invalid [expected=L2][actual=COSINE]: invalid parameter)>
[2024-12-25 16:16:03,525] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 29719) of binary: /home-g2/wupeiyang/anaconda3/envs/llama3/bin/python
Traceback (most recent call last):
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launch.py", line 196, in
main()
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launch.py", line 192, in main
launch(args)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launch.py", line 177, in launch
run(args)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/run.py", line 797, in run
elastic_launch(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 134, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 264, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
Checked other resources
Example Code
The following code:
URI = "./milvus_example.db"
index_params = {
'metric_type': 'COSINE',
'index_type': "FLAT",
# 'params': {"nlist": 128}
}
search_params = {
"metric_type": "COSINE",
# "params": {"nprobe": 12},
}
vector_store = Milvus(
embedding_function=embeddings,
connection_args={"uri": URI},
auto_id=True,
index_params=index_params,
search_params=search_params
)
all_splits = text_splitter.split_documents(documents)
ids = vector_store.add_documents(documents=all_splits)
results = vector_store.similarity_search_with_score(prompt,param=search_params)
Error Message and Stack Trace (if applicable)
RPC error: [search], <MilvusException: (code=1100, message=fail to search: metric type not match: invalid [expected=L2][actual=COSINE]: invalid parameter)>, <Time:{'RPC start': '2024-12-25 16:15:58.358832', 'RPC error': '2024-12-25 16:15:58.359751'}>
0%| | 0/1174 [00:01<?, ?it/s]
Traceback (most recent call last):
File "/home/wupeiyang/work/RTL-Repo/src/generate_data_for_rag_test_dynamic_langchain.py", line 405, in
main()
File "/home/wupeiyang/work/RTL-Repo/src/generate_data_for_rag_test_dynamic_langchain.py", line 306, in main
results = vector_store.similarity_search_with_score(prompt,param=search_params)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/langchain_milvus/vectorstores/milvus.py", line 1182, in similarity_search_with_score
res = self.similarity_search_with_score_by_vector(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/langchain_milvus/vectorstores/milvus.py", line 1221, in similarity_search_with_score_by_vector
col_search_res = self._collection_search(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/langchain_milvus/vectorstores/milvus.py", line 1047, in _collection_search
res = self.col.search(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/orm/collection.py", line 801, in search
resp = conn.search(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 141, in handler
raise e from e
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 137, in handler
return func(*args, **kwargs)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 176, in handler
return func(self, *args, **kwargs)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 116, in handler
raise e from e
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/decorators.py", line 86, in handler
return func(*args, **kwargs)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 805, in search
return self._execute_search(request, timeout, round_decimal=round_decimal, **kwargs)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 746, in _execute_search
raise e from e
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/client/grpc_handler.py", line 735, in _execute_search
check_status(response.status)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/pymilvus/client/utils.py", line 63, in check_status
raise MilvusException(status.code, status.reason, status.error_code)
pymilvus.exceptions.MilvusException: <MilvusException: (code=1100, message=fail to search: metric type not match: invalid [expected=L2][actual=COSINE]: invalid parameter)>
[2024-12-25 16:16:03,525] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 29719) of binary: /home-g2/wupeiyang/anaconda3/envs/llama3/bin/python
Traceback (most recent call last):
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launch.py", line 196, in
main()
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launch.py", line 192, in main
launch(args)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launch.py", line 177, in launch
run(args)
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/run.py", line 797, in run
elastic_launch(
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 134, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/home-g2/wupeiyang/anaconda3/envs/llama3/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 264, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
/home/wupeiyang/work/RTL-Repo/src/generate_data_for_rag_test_dynamic_langchain.py FAILED
Failures:
<NO_OTHER_FAILURES>
Root Cause (first observed failure):
[0]:
time : 2024-12-25_16:16:03
host : localhost
rank : 0 (local_rank: 0)
exitcode : 1 (pid: 29719)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
Description
I'm trying to use langchain_milvus to search by cosine similarity which is supported according to Milvus Doc
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: