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 allowed-special #12

Closed
wants to merge 1 commit into from
Closed

Conversation

FergusFettes
Copy link

@FergusFettes FergusFettes commented Jan 28, 2024

I got an error cause a file I was trying to count the tokens of contained some special tokens. This is a quick fix for that. Happy to make some modifications or write a test if you are interested in this change.

Before:

echo '<|endoftext|>' | ttok
> Long tiktoken error

Now:

echo '<|endoftext|>' | ttok --allowed-special='<|endoftext|>'
2

@simonw
Copy link
Owner

simonw commented May 2, 2024

Thanks for the PR! I ended up solving this a slightly different way:

@simonw simonw closed this May 2, 2024
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