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: allow model selection in client #775

Merged
merged 5 commits into from
Jul 20, 2022
Merged

feat: allow model selection in client #775

merged 5 commits into from
Jul 20, 2022

Conversation

ZiniuYu
Copy link
Member

@ZiniuYu ZiniuYu commented Jul 20, 2022

This pr allows the user to select the model in the client when multiple models are running.

Sample usage:

from clip_client import Client

c = Client(xxx)
c.encode(xxx, parameters={'model': 'RN50'})
c.rank(xxx, parameters={'model': 'RN50'})

@codecov
Copy link

codecov bot commented Jul 20, 2022

Codecov Report

Merging #775 (af6c80f) into main (bc6b72e) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #775      +/-   ##
==========================================
+ Coverage   81.85%   81.91%   +0.05%     
==========================================
  Files          17       17              
  Lines        1251     1255       +4     
==========================================
+ Hits         1024     1028       +4     
  Misses        227      227              
Flag Coverage Δ
cas 81.91% <100.00%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
client/clip_client/client.py 86.66% <100.00%> (+0.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc6b72e...af6c80f. Read the comment docs.

docs/user-guides/client.md Outdated Show resolved Hide resolved
client/clip_client/client.py Outdated Show resolved Hide resolved
payload = dict(
on='/',
on=endpoint,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
on=endpoint,
on=f'/encode/{model_name}',

Copy link
Member Author

Choose a reason for hiding this comment

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

are we introducing extra '/'?

@github-actions
Copy link

📝 Docs are deployed on https://ft-client_model_select--jina-docs.netlify.app 🎉

@ZiniuYu ZiniuYu force-pushed the client_model_select branch from 21cce4b to fd25e96 Compare July 20, 2022 09:32
@ZiniuYu ZiniuYu marked this pull request as ready for review July 20, 2022 10:09
@numb3r3 numb3r3 merged commit 32b11cd into main Jul 20, 2022
@numb3r3 numb3r3 deleted the client_model_select branch July 20, 2022 14:32
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.

2 participants