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: rerank example got an error #535

Closed
miaojinc opened this issue Jun 15, 2024 · 1 comment · Fixed by #538
Closed

bug: rerank example got an error #535

miaojinc opened this issue Jun 15, 2024 · 1 comment · Fixed by #538
Labels
bug Something isn't working

Comments

@miaojinc
Copy link
Contributor

Describe the bug

I try to use mosec's rerank example , but the server got error:
For mosec==0.8.5, the error is:

2024-06-15T00:55:54.001558Z  WARNING mosec::coordinator.py:300 [1869971]: Traceback (most recent call last):
   File "/home/user/mosec/lib/python3.10/site-packages/mosec/coordinator.py", line 274, in coordinate     data = [
   File "/home/user/mosec/lib/python3.10/site-packages/mosec/coordinator.py", line 275, in <listcomp>     self.decode(payload, state)
   File "/home/user/mosec/lib/python3.10/site-packages/mosec/coordinator.py", line 243, in decode     self.worker.deserialize(payload)
   File "/home/user/mosec/lib/python3.10/site-packages/mosec/mixin/typed_worker.py", line 45, in deserialize     return msgspec.msgpack.decode(data, type=self._input_typ)
   TypeError: Type ''Request'' is not supported

For mosec==0.8.4, the error is:

2024-06-15T01:12:16.381367Z  WARNING mosec::coordinator.py:300 [1872350]: Traceback (most recent call last):
   File "/home/user/mosec/lib/python3.10/site-packages/mosec/coordinator.py", line 274, in coordinate     data = [
   File "/home/user/mosec/lib/python3.10/site-packages/mosec/coordinator.py", line 275, in <listcomp>     self.decode(payload, state)
   File "/home/user/mosec/lib/python3.10/site-packages/mosec/coordinator.py", line 243, in decode     self.worker.deserialize(payload)
   File "/home/user/mosec/lib/python3.10/site-packages/mosec/mixin/typed_worker.py", line 43, in deserialize     if not issubclass(self._input_typ, msgspec.Struct):
   TypeError: issubclass() arg 1 must be a class

To Reproduce

pip install mosec
use the code from https://mosecorg.github.io/mosec/examples/rerank.html
python server.py
python client.py

Expected behavior

no error, client got the ranked result

The mosec version

0.8.5, 0.8.4

Additional context

No response

@miaojinc miaojinc added the bug Something isn't working label Jun 15, 2024
@kemingy
Copy link
Member

kemingy commented Jun 15, 2024

Thanks for your feedback. It is related to the OpenAPI spec generation. This is due to the Python type annotation lazy evaluation. I'll create a PR to enable the inspect.get_annotations(eval_str=True) for all the supported Python version (>=3.8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants