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

Add bot_token attribute to PreTrainedTokenizer and PreTrainedTokenizerFast #31709

Open
aw632 opened this issue Jun 29, 2024 · 1 comment
Open
Labels
Feature request Request for a new feature

Comments

@aw632
Copy link

aw632 commented Jun 29, 2024

Feature request

I'm requesting for the attribute bot_token (beginning-of-tools token) to be added to the PreTrainedTokenizer classes, similar to eos_token. This token would be associated with self.bot_token and self.bot_token_id and would expose the token to downstream consumers like vLLM.

Motivation

This request builds off this PR comment as well as the ongoing work to support function calling in transformers.

A number of downstream consumers depend on what's available in the PreTrainedTokenizer classes, like vLLM's Sequence class and LLMEngine class example. For example, the current problem I'm facing is that vLLM doesn't correctly label the finish reason for "tool call" outputs, as, well, tool calls, since the CompletionOutput.finish_reason ultimately relies on the attributes available in PreTrainedTokenizer.

As open-source tool calling proliferates, having these attributes exposed would greatly enhance the utility of the library. This token can be set to None by default and should be backwards compatible with the right implementation.

Your contribution

I can help contribute to the PR and write code. Might need help navigating the library + writing good test cases.

@aw632 aw632 added the Feature request Request for a new feature label Jun 29, 2024
@amyeroberts
Copy link
Collaborator

cc @Rocketknight1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants