-
Notifications
You must be signed in to change notification settings - Fork 531
Use external hf_tokenizer in llama runner #9112
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/9112
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 4ff5d8b with merge base c5dd476 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
de6b735
to
a536432
Compare
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.
Update - will change to use extension/llm/tokenizers/src/hf_tokenizer.cpp as real impl
08e7b04
to
4d29fda
Compare
9b69efe
to
51323bc
Compare
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.
@swolchok This PR changed to directly use the hf tokenizer from https://github.com/pytorch-labs/tokenizers, can you give it a re-review? Most of your comments don't apply anymore as a result, but I addressed the ones that do
75dd028
to
63b2ed7
Compare
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.
seems fine. sorry for the slow turnaround; feel free to ping me after it's been a day
63b2ed7
to
dc8a31a
Compare
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
031d404
to
7fdb8ae
Compare
7d210be
to
846951e
Compare
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
auto json_tokenizer = std::make_unique<tokenizers::HFTokenizer>(); | ||
if (json_tokenizer->load(tokenizer_path) == ::tokenizers::Error::Ok) { | ||
ET_LOG(Info, "Loaded json tokenizer"); | ||
return json_tokenizer; | ||
} |
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.
Are custom special tokens, added tokens, etc already included in the tokenizer.json? Personally I haven't validated this yet, but I think we should before we claim HF tokenizer is supported.
@jackzhxng has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary
Use https://github.com/pytorch-labs/tokenizers huggingface tokenizer in the Llama runner.
Results on Qwen2.5 with
extension/llm/tokenizers
checked out to pytorch-labs/tokenizers#50:Test plan
Build llama runner locally (note the inclusion of
-DSUPPORT_REGEX_LOOKAHEAD=ON
):Run on Qwen2.5: