-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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_special option for server tokenize endpoint #7059
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not use the tokenize endpoint on my end.
But is it worth the effort to add a test case ?
I'm using the /completion endpoint with lists of tokens instead of strings, and I thought it would be nice if the client didn't need to know how the model represents the BOS token, now that there's a bunch of new models which don't use It's a pretty small feature, but I can look into adding a test if you prefer. |
As an FYI, |
Yeah this seems to be an useful thing, since sometimes we want to tokenize a part of text (BOS should not be added in this case) For extra safe, I'd suggest a test case like this: Tokenize a text with |
@ngxson currently trying to understand the python behave framework and how to formulate the tests :) I'm not sure how to express something like "when the following string is tokenized, the resulting length must be longer than when this other string is tokenized" in behave, but perhaps I could figure it out. Was thinking I would look up the BOS token for the test model (I'm guessing it's Update: The above did not work, the tokenizer in tinyllamas/stories260K.gguf behaves strange. I'll hard-code the BOS token as [1] in the tests and check for that instead, not really worse than hard-coding it to |
Instead of hard-coding, another idea would be to input the BOS as a behave step, something like:
The handler for that is defined at the beginning of |
@ngxson yea, perhaps that is better. Changed it to do that. |
No description provided.