[taskflow]fix taskflow pir bug#9871
Closed
Fantasy-02 wants to merge 16 commits into
Closed
Conversation
…h19/PaddleNLP into dev_20250124_fix_taskflow_infer
|
Thanks for your contribution! |
DrownFish19
reviewed
Feb 14, 2025
| for block in program.blocks: | ||
| for op in block.ops: | ||
| if op.type.count("quantize"): | ||
| if "quantize" in op.name(): |
DrownFish19
reviewed
Feb 14, 2025
|
|
||
| if "rocketqav2-en" in model or "ernie-search" in model: | ||
| self._model = ErnieCrossEncoder(self._task_path, num_classes=1, reinitialize=True) | ||
| self._model = ErnieCrossEncoder(self._task_path, num_classes=2, reinitialize=True) |
Collaborator
There was a problem hiding this comment.
这里修改了模型的num_classes,是否准确?
Contributor
Author
There was a problem hiding this comment.
他这里加载的模型参数,就是num_classes = 2的
| self._construct_tokenizer() | ||
| self._check_predictor_type() | ||
| self._get_inference_model() | ||
| if self._static_mode: |
| probs = self.ernie.classifier(pooled_output) | ||
| return probs | ||
| cls_embedding = self.ernie.classifier(pooled_output) | ||
| probs = F.softmax(cls_embedding, axis=1) |
Contributor
Author
There was a problem hiding this comment.
参考了前面的match函数,然后也打印调试看过结果,发现二分类需要经过softmax,然后也用了案例去验证了一下正确性
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #9871 +/- ##
========================================
Coverage 51.41% 51.42%
========================================
Files 745 745
Lines 118351 118364 +13
========================================
+ Hits 60856 60863 +7
- Misses 57495 57501 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before submitting
testsfolder. If there are codecov issues, please add tests cases first.PR types
Bug fixes
PR changes
Others
Description
fix bug when pir=True