-
Notifications
You must be signed in to change notification settings - Fork 3k
【PaddleNLP No.20】Create ernie-3.0 deploy with paddle.inference & add training without hf #10475
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
Conversation
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a Paddle Inference–based deploy for the Ernie‑3.0 model and introduces an alternative training script for NER when Hugging Face connectivity is unavailable.
- Adds a new script (run_token_cls_without_hf.py) for NER training without HF.
- Updates inference scripts (infer.py, token_cls_infer.py, seq_cls_infer.py) to leverage paddle.inference with new model file suffixes.
- Revises documentation in README files to reflect deployment changes.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
slm/model_zoo/ernie-3.0/run_token_cls_without_hf.py | Adds an alternative training script for NER. |
slm/model_zoo/ernie-3.0/infer.py | Updates inference file paths to use new suffixes. |
slm/model_zoo/ernie-3.0/deploy/python/token_cls_infer.py | Replaces fastdeploy with paddle.inference and adjusts preprocessing/postprocessing. |
slm/model_zoo/ernie-3.0/deploy/python/seq_cls_infer.py | Updates prediction logic and removes fastdeploy dependencies. |
slm/model_zoo/ernie-3.0/deploy/python/README.md | Revises usage examples to reflect updated inference arguments. |
slm/model_zoo/ernie-3.0/README.md | Adds deploy instructions for infer.py and run_token_cls_without_hf.py. |
Comments suppressed due to low confidence (2)
slm/model_zoo/ernie-3.0/infer.py:190
- Ensure that args.model_path includes a trailing path separator or consider using os.path.join to construct the complete model file path, so that the concatenated file name is formed correctly.
model_file=args.model_path + f"model{PADDLE_INFERENCE_MODEL_SUFFIX}"
slm/model_zoo/ernie-3.0/deploy/python/token_cls_infer.py:100
- Verify that converting infer_data to a numpy array returns the expected shape; if the inference API now wraps the results differently compared to previous versions, you may need to adjust the postprocessing accordingly.
result = np.array(infer_data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
❌ Your project status has failed because the head coverage (48.92%) 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 #10475 +/- ##
===========================================
- Coverage 48.99% 48.92% -0.07%
===========================================
Files 765 767 +2
Lines 125974 126238 +264
===========================================
+ Hits 61720 61766 +46
- Misses 64254 64472 +218 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR types
Function optimization
PR changes
Models
Description
slm/model_zoo/ernie-3.0/infer.py
加入文档,并进行PIR适配;slm/model_zoo/ernie-3.0/run_token_cls_without_hf.py
;slm/model_zoo/ernie-3.0/README.md
;FastDeploy
与paddle 3.0.0不适配的情况,重新实现基于paddle.inference的推理脚本,包括文本分类与NER两个任务;slm/model_zoo/ernie-3.0/deploy/python/seq_cls_infer.py
slm/model_zoo/ernie-3.0/deploy/python/token_cls_infer.py
slm/model_zoo/ernie-3.0/deploy/python/README.md
。Issue: #9763
@DrownFish19