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

[Tokenizer] Support adding special tokens to Qwen tokenizer #9344

Merged

Conversation

DrownFish19
Copy link
Collaborator

PR types

New features

PR changes

APIs

Description

Support adding special tokens to Qwen tokenizer.

Note: Qwen tokenizer does not support adding normal tokens.

example:

from paddlenlp.transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("qwen/qwen-7b")

tokenizer.add_special_tokens({"cls_token": "<CLS>"})

tokenizer.add_special_tokens({"additional_special_tokens":["<img>"]})

Copy link

paddle-bot bot commented Oct 31, 2024

Thanks for your contribution!

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 70.58824% with 5 lines in your changes missing coverage. Please review.

Project coverage is 52.89%. Comparing base (483fff4) to head (f99fe98).
Report is 3 commits behind head on develop.

Current head f99fe98 differs from pull request most recent head 0ea84ca

Please upload reports for the commit 0ea84ca to get more accurate results.

Files with missing lines Patch % Lines
paddlenlp/transformers/qwen/tokenizer.py 70.58% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9344      +/-   ##
===========================================
- Coverage    52.91%   52.89%   -0.03%     
===========================================
  Files          673      673              
  Lines       107742   107711      -31     
===========================================
- Hits         57009    56970      -39     
- Misses       50733    50741       +8     

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

Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

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

LGTM

@ZHUI ZHUI merged commit 71dafa6 into PaddlePaddle:develop Nov 1, 2024
10 of 12 checks passed
@DrownFish19 DrownFish19 deleted the dev_20241031_fix_qwen_tokenizer branch November 1, 2024 06:37
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