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

[Inference] Update DygraphInferencePredictor #9491

Merged

Conversation

DrownFish19
Copy link
Collaborator

@DrownFish19 DrownFish19 commented Nov 25, 2024

PR types

Bug fixes

PR changes

Others

Description

  1. Fix DygraphInferencePredictor returned None.
  2. Fix BlockInferencePredictorMixin when len(input_texts) < batch_size.

Copy link

paddle-bot bot commented Nov 25, 2024

Thanks for your contribution!

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.84%. Comparing base (d455181) to head (f4f26a2).
Report is 13 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9491      +/-   ##
===========================================
- Coverage    53.19%   52.84%   -0.36%     
===========================================
  Files          700      699       -1     
  Lines       110757   110376     -381     
===========================================
- Hits         58921    58326     -595     
- Misses       51836    52050     +214     

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

@@ -719,10 +719,9 @@ def _infer(self, inputs: dict[str, paddle.Tensor]):
inputs[key] = paddle.to_tensor(inputs[key])

inputs["cache_kvs"] = self.cache_kvs
self.model.generate(
return self.model.generate(
**inputs,
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

修复返回None的问题

@@ -904,6 +903,8 @@ def _preprocess(self, input_text: list[str]):
input_text = [input_text] if isinstance(input_text, str) else input_text
input_text = [self.tokenizer.apply_chat_template(sentence, tokenize=False) for sentence in input_text]

input_text_batch_size = len(input_text)
Copy link
Collaborator Author

@DrownFish19 DrownFish19 Nov 26, 2024

Choose a reason for hiding this comment

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

修复输入数据不是完整batch_size的问题

@DrownFish19 DrownFish19 force-pushed the dev_20241124_update_generator branch from ca61bec to 7b83fb1 Compare December 1, 2024 05:44
@ZHUI ZHUI merged commit 0b6284e into PaddlePaddle:develop Dec 2, 2024
9 of 12 checks passed
@DrownFish19 DrownFish19 deleted the dev_20241124_update_generator branch December 2, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants