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

Bugfix train tokenization qwen #33

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

maxime-louis
Copy link
Collaborator

Label delimitation problem fix with Qwen:
Mistral/llama/solar/gemma tokenizers all have:
user_message + generatino_prompt + answer != chat_template(user_message, answer):
As they always add an extra newline in the second case. Qwen doesn't do that, so our way of using the length of "user_message + generatino_prompt" (:= position) to delimitate the label for training does not work.

With this fix:

  • we try to recover the label at (position) and (position - 1)

=> Behaviour is unchanged for all models but Qwen
=> Alexandre ran multiple experiments with Qwen and that code: all works well, no warning.

Qwen pad_token handling
Qwen has no bos_token, which we used as padding in bergen: we take pad_token if it exists (it does for Qwen), and eos_token in last resort.

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.

1 participant