-
Notifications
You must be signed in to change notification settings - Fork 3
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 support for o200k tokenization #16
Conversation
crates/bpe/src/byte_pair_encoding.rs
Outdated
if let Some(j) = bytes_hash_to_token.insert(hash_bytes(&token), i as u32) { | ||
eprintln!("collision: ({i}, {j})"); | ||
} |
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.
should the function return an error instead when this happens?
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.
If this happens, the assertion below the loop will fail. I wonder if we want to provide a way to specify the factor as part of the API, if anyone wants to construct a BPE from their own dictionary. The hard-coded constant might make it harder to reuse this if users bring their own tokens. But I'll save that for a follow-up PR.
/// 3. Run [`update_token_dicts`] tests below to update data files. | ||
#[test] | ||
#[ignore = "run manually to find a suitable hash factor"] | ||
fn find_hash_factor() { |
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.
:)
crates/bpe/src/byte_pair_encoding.rs
Outdated
#[test] | ||
fn test_serialize() { | ||
#[ignore = "run manually to update data files"] |
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.
in principle, we could let this test run normally, since it will fix the broken data file (and one will see in the diff that something has changed)
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.
Yes, let's do that.
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.
What are the benchmark numbers for o200k?
Did things get slower?
No description provided.