Skip to content

【PaddleNLP No.6】Fix text_classification PIR #10497

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 1 commit into from
May 6, 2025

Conversation

hanlintang
Copy link
Contributor

PR types

Bug fixes

PR changes

Models

Description

  1. 添加text_classification中rretrieval_based的hierarchical/multi_class/multi_label模型基于paddle.inference推理对PIR的适配;
  2. 修改设计到导出模型的文档。
    修改部分可以成功运行推理。
I0425 05:49:54.312034 17340 pir_interpreter.cc:1640] pir interpreter is running by trace mode ...
(1, 768)
......
   5.13511896e-02  1.27085205e-02 -1.99236199e-02 -3.18305828e-02
  -6.04303088e-03 -2.46610641e-02 -1.73023611e-03 -6.33593462e-03
  -1.72202699e-02  1.04825031e-02 -5.76227345e-03 -2.10440122e-02
   4.56353836e-02 -1.11948913e-02  3.09750624e-02  4.88217883e-02
   6.00924827e-02 -1.12980399e-02  2.02461407e-02  4.56624702e-02
  -2.55786590e-02  3.89200114e-02 -9.09841619e-03  4.24942374e-02
  -6.72577918e-02  7.34342411e-02  2.94713527e-02 -5.68274520e-02
   5.37596755e-02 -2.73752045e-02  2.10331194e-02  4.71913368e-02]]
[0.6664873361587524, 0.4887930154800415]

Modified:

  1. slm/applications/text_classification/hierarchical/retrieval_based/deploy/python/predict.py
  2. slm/applications/text_classification/hierarchical/retrieval_based/utils/feature_extract.py
  3. slm/applications/text_classification/multi_class/retrieval_based/deploy/python/predict.py
  4. slm/applications/text_classification/multi_class/retrieval_based/utils/feature_extract.py
  5. slm/applications/text_classification/multi_label/README.md
  6. slm/applications/text_classification/multi_label/retrieval_based/deploy/python/predict.py
  7. slm/applications/text_classification/multi_label/retrieval_based/utils/feature_extract.py

其他问题

  1. 本次修改验证了三个模型的训练、导出及paddle.inference推理。没有修改paddle_serving, simple_serving, triton_serving及onnx部署的内容,因为其已经无法与paddle3.0.0适配,如onnx部署:
[2025-04-24 11:21:34,047] [    INFO] - >>> [InferBackend] Creating Engine ...
Traceback (most recent call last):
  File "infer.py", line 69, in <module>
    predictor = Predictor(args, label_list)
  File "/home/aistudio/PaddleNLP/slm/applications/text_classification/hierarchical/deploy/predictor/predictor.py", line 121, in __init__
    self.inference_backend = InferBackend(
  File "/home/aistudio/PaddleNLP/slm/applications/text_classification/hierarchical/deploy/predictor/predictor.py", line 35, in __init__
    onnx_model = paddle2onnx.export(
TypeError: export() got an unexpected keyword argument 'model_file'
  1. 没有修改few-shot的部分,根据文档该部分将在未来删除,并推荐使用其他zero-shot模型。

Issue: #9763
@DrownFish19

Copy link

paddle-bot bot commented Apr 25, 2025

Thanks for your contribution!

Copy link

codecov bot commented Apr 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.67%. Comparing base (323ffec) to head (f8d612b).
Report is 27 commits behind head on develop.

❌ Your project status has failed because the head coverage (48.67%) is below the target coverage (58.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #10497      +/-   ##
===========================================
- Coverage    48.68%   48.67%   -0.01%     
===========================================
  Files          768      768              
  Lines       126915   126915              
===========================================
- Hits         61785    61777       -8     
- Misses       65130    65138       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Apr 27, 2025
@luotao1 luotao1 assigned luotao1 and DrownFish19 and unassigned gongel Apr 27, 2025
Copy link
Collaborator

@DrownFish19 DrownFish19 left a comment

Choose a reason for hiding this comment

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

LGTM

@DrownFish19 DrownFish19 merged commit 1aadf1b into PaddlePaddle:develop May 6, 2025
11 of 12 checks passed
@hanlintang hanlintang deleted the text_classification branch May 6, 2025 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants