Skip to content

llama : optimize long word tokenization with WPM #8034

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

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

ggerganov
Copy link
Member

@ggerganov ggerganov commented Jun 20, 2024

fix #8029

  • more efficient "longest token" search for very long words, utilizing vocab.max_token_len
  • reuse llm_tokenizer_wpm instance in loop
  • reserve array in unicode_cpts_from_utf8

@ggerganov ggerganov force-pushed the gg/max-token-length branch from fb29bda to 677bf2e Compare June 20, 2024 11:50
@ggerganov ggerganov merged commit a927b0f into master Jun 21, 2024
72 checks passed
@ggerganov ggerganov deleted the gg/max-token-length branch June 21, 2024 05:51
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Jun 30, 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.

Bug: Embedding endpoint takes exponential time to process a long unknown token
1 participant