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

feat: support clip retrieval #816

Merged
merged 13 commits into from
Sep 9, 2022
Merged

feat: support clip retrieval #816

merged 13 commits into from
Sep 9, 2022

Conversation

numb3r3
Copy link
Member

@numb3r3 numb3r3 commented Sep 8, 2022

  • support multi-model encoding
  • add index and search API

@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #816 (0626bd4) into main (4461d2e) will increase coverage by 0.40%.
The diff coverage is 87.77%.

❗ Current head 0626bd4 differs from pull request most recent head e1190ae. Consider uploading reports for the commit e1190ae to get more accurate results

@@            Coverage Diff             @@
##             main     #816      +/-   ##
==========================================
+ Coverage   83.90%   84.30%   +0.40%     
==========================================
  Files          21       21              
  Lines        1466     1548      +82     
==========================================
+ Hits         1230     1305      +75     
- Misses        236      243       +7     
Flag Coverage Δ
cas 84.30% <87.77%> (+0.40%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/clip_server/model/clip_model.py 87.50% <0.00%> (ø)
server/clip_server/model/clip_onnx.py 88.88% <ø> (+6.66%) ⬆️
server/clip_server/model/clip_trt.py 85.71% <ø> (ø)
client/clip_client/client.py 87.45% <88.50%> (+0.12%) ⬆️
client/clip_client/__init__.py 100.00% <100.00%> (ø)
server/clip_server/__init__.py 100.00% <100.00%> (ø)
server/clip_server/executors/clip_torch.py 82.53% <0.00%> (-3.18%) ⬇️
server/clip_server/executors/clip_onnx.py 84.05% <0.00%> (+2.89%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@numb3r3 numb3r3 mentioned this pull request Sep 9, 2022
return self._unboxed_result(results)

@overload
async def aindex(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need aindex in the client? The logic of index in the server is not blocked since we use a queue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripts/streamlit.py Outdated Show resolved Hide resolved
from client.clip_client.client import Client

client = Client('grpc://0.0.0.0:61000')
st.title('Laion400M retrieval')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the name to something more meaningful

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this streamlit script looks like a toy, I will delete it from this PR.

@@ -118,9 +117,13 @@ def encode(self, content, **kwargs):
)
results = DocumentArray()
with self._pbar:
parameters = kwargs.pop('parameters', None)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why pop not get

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to clean kwargs.

@@ -1,7 +1,6 @@
import mimetypes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can reuse some codes in this file since its getting quite big

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly. But this is not the response of this PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK but don't do it too soon 🥲pls wait for my PRs

numb3r3 and others added 2 commits September 9, 2022 15:04
Co-authored-by: Ziniu Yu <ziniuyu@gmail.com>
@ZiniuYu ZiniuYu marked this pull request as ready for review September 9, 2022 09:03


@pytest.fixture(params=['torch'])
def make_search_flow(tmpdir, port_generator, request):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where do you define this tmpdir?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used as workspace in annlite executor

@numb3r3 numb3r3 merged commit a07a521 into main Sep 9, 2022
@numb3r3 numb3r3 deleted the feat-retrieval branch September 9, 2022 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants