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: encode text first when both text and uri are presented #795

Merged
merged 5 commits into from
Aug 5, 2022

Conversation

ZiniuYu
Copy link
Member

@ZiniuYu ZiniuYu commented Aug 4, 2022

In previous versions, when a doc contains both text and URI fields, clip_server will treat it as an image doc.
In this pr we encode text first since the text is a content attribute and URI is only a source of content.
So now when a doc has text and URI fields, we will consider it as a text doc.

@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

Merging #795 (6220a2a) into main (7c6708f) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #795      +/-   ##
==========================================
+ Coverage   83.75%   83.79%   +0.04%     
==========================================
  Files          21       21              
  Lines        1440     1438       -2     
==========================================
- Hits         1206     1205       -1     
+ Misses        234      233       -1     
Flag Coverage Δ
cas 83.79% <100.00%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
server/clip_server/executors/helper.py 96.96% <100.00%> (+1.38%) ⬆️

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

@ZiniuYu ZiniuYu marked this pull request as ready for review August 4, 2022 06:04
@ZiniuYu ZiniuYu changed the title fix: encode text first when both text and uri are presented feat: encode text first when both text and uri are presented Aug 4, 2022
Document(text='goodbye, world'),
Document(
text='hello, world',
uri='https://docarray.jina.ai/_static/favicon.png',
Copy link
Member

Choose a reason for hiding this comment

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

also coverage the docs with blob and tensor

Copy link
Member

Choose a reason for hiding this comment

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

tensor = [0, 1, 2, 3] or tensor = np.array([0, 1, 2, 3])

Copy link
Member Author

Choose a reason for hiding this comment

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

🥹

@numb3r3
Copy link
Member

numb3r3 commented Aug 4, 2022

@ZiniuYu BTW, do we need also to update the client side?

@ZiniuYu
Copy link
Member Author

ZiniuYu commented Aug 4, 2022

@ZiniuYu BTW, do we need also to update the client side?

@numb3r3 client happened to handle text first so I think no need to change

Copy link
Member

@numb3r3 numb3r3 left a comment

Choose a reason for hiding this comment

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

LGTM

@numb3r3 numb3r3 merged commit 65032f0 into main Aug 5, 2022
@numb3r3 numb3r3 deleted the text-first branch August 5, 2022 06:36
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.

None yet

2 participants