Skip to content

Conversation

@yuanlehome
Copy link
Collaborator

PR types

Bug fixes

PR changes

Models

Description

fix pad_token_id bug.

@paddle-bot
Copy link

paddle-bot bot commented Jul 26, 2024

Thanks for your contribution!

@codecov
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 55.51%. Comparing base (6f56bd4) to head (2d3f2ee).
Report is 230 commits behind head on develop.

Files with missing lines Patch % Lines
paddlenlp/generation/utils.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## develop #8814 +/- ## =========================================== - Coverage 55.52% 55.51% -0.02%  =========================================== Files 630 631 +1 Lines 98365 99128 +763 =========================================== + Hits 54619 55032 +413  - Misses 43746 44096 +350 

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

# TODO(wj-Mcat): fix llama tokenzier pad_token bug
if (isinstance(tokenizer, (LlamaTokenizer, Llama3Tokenizer))) and not tokenizer.pad_token:
tokenizer.pad_token = tokenizer.bos_token
tokenizer.pad_token = tokenizer.eos_token
Copy link
Collaborator Author

@yuanlehome yuanlehome Jul 26, 2024

Choose a reason for hiding this comment

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

这个解决动态图推理
390d2e730b547908bde5554687b68317

logger.warning(
"Setting `pad_token_id` to `eos_token_id`:{} for " "open-end generation.".format(eos_token_id)
)
if isinstance(eos_token_id, list):
Copy link
Collaborator Author

@yuanlehome yuanlehome Jul 26, 2024

Choose a reason for hiding this comment

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

这个解决动转静
52000b7d71117856c208ddb35beb6bd6

Copy link
Contributor

@wawltor wawltor left a comment

Choose a reason for hiding this comment

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

LGTM

@wawltor wawltor merged commit 6ea9dc0 into PaddlePaddle:develop Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants