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 onnx backend for openclip #781

Merged
merged 8 commits into from
Jul 26, 2022
Merged

feat: support onnx backend for openclip #781

merged 8 commits into from
Jul 26, 2022

Conversation

numb3r3
Copy link
Member

@numb3r3 numb3r3 commented Jul 25, 2022

No description provided.

@codecov
Copy link

codecov bot commented Jul 25, 2022

Codecov Report

Merging #781 (bd04402) into main (f043b4d) will increase coverage by 0.20%.
The diff coverage is 81.15%.

@@            Coverage Diff             @@
##             main     #781      +/-   ##
==========================================
+ Coverage   85.72%   85.92%   +0.20%     
==========================================
  Files          21       21              
  Lines        1121     1137      +16     
==========================================
+ Hits          961      977      +16     
  Misses        160      160              
Flag Coverage Δ
cas 85.92% <81.15%> (+0.20%) ⬆️

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

Impacted Files Coverage Δ
server/clip_server/executors/clip_torch.py 87.93% <ø> (ø)
server/clip_server/model/mclip_model.py 83.33% <0.00%> (ø)
server/clip_server/model/clip_onnx.py 82.22% <78.94%> (-6.02%) ⬇️
server/clip_server/model/clip_trt.py 85.71% <78.94%> (-6.40%) ⬇️
server/clip_server/model/openclip_model.py 83.33% <81.25%> (+17.47%) ⬆️
server/clip_server/model/clip_model.py 87.50% <91.66%> (+3.28%) ⬆️
server/clip_server/executors/clip_onnx.py 85.93% <100.00%> (ø)
server/clip_server/executors/clip_tensorrt.py 100.00% <100.00%> (ø)
server/clip_server/model/clip.py 92.10% <0.00%> (-1.32%) ⬇️

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 f043b4d...bd04402. Read the comment docs.

@github-actions github-actions bot added size/m and removed size/s labels Jul 25, 2022
@numb3r3 numb3r3 requested review from shan-mx, ZiniuYu and jemmyshin July 25, 2022 08:31
elif self._model_name.endswith('-quickgelu'):
return self._model_name[:-10]
return self._model_name.replace('/', '-')
elif model_name.endswith('-quickgelu'):
Copy link
Member

Choose a reason for hiding this comment

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

there will be no quickgelu

Comment on lines +13 to +19
@staticmethod
def get_model_name(name: str):
return name

@property
def model_name(self):
return self.__class__.get_model_name(self._name)
Copy link
Member

Choose a reason for hiding this comment

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

can we simply return xxx.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.

To get the model name without initializing the instance (avoiding downloading and loading weights), we must use staticmethod . That's the reason I implement get_model_name

Copy link
Contributor

@jemmyshin jemmyshin 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 force-pushed the fix-onnx-openclip branch from 8b90a87 to ddf86cf Compare July 26, 2022 03:21
@numb3r3 numb3r3 merged commit 8bd8389 into main Jul 26, 2022
@numb3r3 numb3r3 deleted the fix-onnx-openclip branch July 26, 2022 04:13
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