Giter Site home page Giter Site logo

vald-client-python's People

Contributors

datelier avatar hlts2 avatar kmrmt avatar kpango avatar rinx avatar vdaas-ci avatar zhanpon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vald-client-python's Issues

Searching in the example code does not work

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}"

`

Can't insert vectors (Error parsing 'content-type' metadata: invalid value)

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"}"
>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.