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

Tiktoken wrapper add_eos_token option #681

Merged
merged 6 commits into from
Oct 20, 2023
Merged

Conversation

rajammanabrolu
Copy link
Contributor

Modify the tiktoken wrapper to mimic HF Llama tokenizer behavior to add either or both BOS/EOS tokens while encoding (add_eos_token option in build_inputs_with_special_tokens and corresponding change to get_special_tokens_mask)

Copy link
Collaborator

@dakinggg dakinggg left a comment

Choose a reason for hiding this comment

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

Could you add some simple unit tests to test this functionality? Just that whatever API you want to use (encode_plus I think?) works the way it should.

@rajammanabrolu
Copy link
Contributor Author

Added tests, mimics how I'll use it in the RL loop. Lmk if there's more things I should be adding

@rajammanabrolu rajammanabrolu enabled auto-merge (squash) October 20, 2023 21:41
@rajammanabrolu rajammanabrolu merged commit f65b07e into main Oct 20, 2023
12 checks passed
@dakinggg dakinggg deleted the raj/tiktoken-changes branch November 17, 2023 06:08
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