-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
numb3r3
commented
Sep 8, 2022
•
edited
Loading
edited
- support multi-model encoding
- add index and search API
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
return self._unboxed_result(results) | ||
|
||
@overload | ||
async def aindex( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See tips in this section ->https://clip-as-service.jina.ai/user-guides/client/#async-encoding
scripts/streamlit.py
Outdated
from client.clip_client.client import Client | ||
|
||
client = Client('grpc://0.0.0.0:61000') | ||
st.title('Laion400M retrieval') |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why pop
not get
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Co-authored-by: Ziniu Yu <[email protected]>
|
||
|
||
@pytest.fixture(params=['torch']) | ||
def make_search_flow(tmpdir, port_generator, request): |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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