vdaas / vald-client-python Goto Github PK
View Code? Open in Web Editor NEWA Python gRPC client library for Vald
Home Page: https://pypi.org/project/vald-client-python/
License: Apache License 2.0
A Python gRPC client library for Vald
Home Page: https://pypi.org/project/vald-client-python/
License: Apache License 2.0
Hello,
I was trying to run the provided example against a vald instance installed in a k8s cluster.
While Insert, Update, and Remove works as expected, I'm getting the following error for search:
Command:
scfg = payload_pb2.Search.Config(num=100, radius=-1.0, epsilon=0.01, timeout=3000000000)
res = sstub.Search(payload_pb2.Search.Request(vector=[0.2, 0.2, 0.3], config=scfg))
Error:
`---------------------------------------------------------------------------
_InactiveRpcError Traceback (most recent call last)
in
1 scfg = payload_pb2.Search.Config(num=100, radius=-1.0, epsilon=0.01, timeout=3000000000)
----> 2 res = sstub.Search(payload_pb2.Search.Request(vector=[0.2, 0.2, 0.3], config=scfg))
~/anaconda3/lib/python3.8/site-packages/grpc/_channel.py in call(self, request, timeout, metadata, credentials, wait_for_ready, compression)
921 state, call, = self._blocking(request, timeout, metadata, credentials,
922 wait_for_ready, compression)
--> 923 return _end_unary_response_blocking(state, call, False, None)
924
925 def with_call(self,
~/anaconda3/lib/python3.8/site-packages/grpc/_channel.py in _end_unary_response_blocking(state, call, with_call, deadline)
824 return state.response
825 else:
--> 826 raise _InactiveRpcError(state)
827
828
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INTERNAL
details = "Search API failed to process search request"
debug_error_string = "{"created":"@1613339575.111192823","description":"Error received from peer ipv4:10.30.241.242:8081","file":"src/core/lib/surface/call.cc","file_line":1067,"grpc_message":"Search API failed to process search request","grpc_status":13}"
`
Hi, I've deployed a vald
cluster using instruction here, and now trying to insert vectors using the following code:
channel = grpc.insecure_channel(f'{host}:{port}')
istub = insert_pb2_grpc.InsertStub(channel)
sstub = search_pb2_grpc.SearchStub(channel)
print('opened channel')
if init:
icfg = payload_pb2.Insert.Config(skip_strict_exist_check = True)
for i, doc in enumerate(read_docs()):
doc_id = f"{i}@{doc.metadata['source']}"
# print(doc_id)
# print(embeddings.embed_document(doc))
vec = payload_pb2.Object.Vector(id = doc_id, vector = embeddings.embed_document(doc))
istub.Insert(payload_pb2.Insert.Request(vector = vec, config = icfg))
scfg = payload_pb2.Search.Config(num = 10, radius = -1.0, epsilon = 0.01, timeout = 3600)
result = sstub.Search(payload_pb2.Search.Request(vector = embeddings.embed_query(text = query), config = scfg))
print(result)
channel.close()
print('closed channel')
return
I've expected that script inserts the document vectors into the database and performs search using the provided query. However, the actual output is the following:
opened channel
E1220 14:08:25.949464474 9902 hpack_parser.cc:999] Error parsing 'content-type' metadata: invalid value
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/zeio/villm/villm/__main__.py", line 247, in <module>
main()
File "/home/zeio/miniconda3/envs/villm/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zeio/miniconda3/envs/villm/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/zeio/miniconda3/envs/villm/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zeio/miniconda3/envs/villm/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zeio/miniconda3/envs/villm/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zeio/villm/villm/__main__.py", line 212, in status
istub.Insert(payload_pb2.Insert.Request(vector = vec, config = icfg))
File "/home/zeio/miniconda3/envs/villm/lib/python3.11/site-packages/grpc/_channel.py", line 1160, in __call__
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zeio/miniconda3/envs/villm/lib/python3.11/site-packages/grpc/_channel.py", line 1003, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNKNOWN
details = "Stream removed"
debug_error_string = "UNKNOWN:Error received from peer {grpc_message:"Stream removed", grpc_status:2, created_time:"2023-12-20T14:08:25.94962146+03:00"}"
>
Hi all, can I insert vectors with tags?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.