Skip to content

TextSimilarityTask support onnx #5841

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

Merged
merged 2 commits into from
May 10, 2023
Merged

Conversation

jadepeng
Copy link
Contributor

@jadepeng jadepeng commented May 5, 2023

PR types

New features

PR changes

Others

Description

ErnieRanker 中,text_similarity 开启fp16不生效,原因是TextSimilarityTask未开启onnx支持

self.transformer_model = Taskflow(
            "text_similarity", 
            precision="fp16",
            model=model_name_or_path, 
            batch_size=self.batch_size, device_id=0 if use_gpu else -1
        )

当前增加了相关支持

@paddle-bot
Copy link

paddle-bot bot commented May 5, 2023

Thanks for your contribution!

@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Merging #5841 (0f168fd) into develop (90cbb21) will decrease coverage by 0.01%.
The diff coverage is 57.14%.

❗ Current head 0f168fd differs from pull request most recent head 7785398. Consider uploading reports for the commit 7785398 to get more accurate results

@@             Coverage Diff             @@
##           develop    #5841      +/-   ##
===========================================
- Coverage    61.85%   61.84%   -0.01%     
===========================================
  Files          490      490              
  Lines        69003    69011       +8     
===========================================
- Hits         42680    42679       -1     
- Misses       26323    26332       +9     
Impacted Files Coverage Δ
paddlenlp/taskflow/text_similarity.py 89.23% <57.14%> (-4.22%) ⬇️

... and 2 files with indirect coverage changes

Copy link
Collaborator

@sijunhe sijunhe left a comment

Choose a reason for hiding this comment

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

麻烦 @w5688414 review.
lint的问题麻烦修一下,不方便配本地环境的话,直接以这个branch开一个github codespace, 然后make install配好环境,再pre-commit run --files 即可

@w5688414
Copy link
Contributor

w5688414 commented May 9, 2023

麻烦 @w5688414 review. lint的问题麻烦修一下,不方便配本地环境的话,直接以这个branch开一个github codespace, 然后make install配好环境,再pre-commit run --files 即可

已修改

@w5688414 w5688414 self-requested a review May 9, 2023 16:40
Copy link
Contributor

@w5688414 w5688414 left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. LGTM

@sijunhe sijunhe merged commit d66ab8e into PaddlePaddle:develop May 10, 2023
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