Crates.io | tiktoken-rust |
lib.rs | tiktoken-rust |
version | 0.2.1 |
source | src |
created_at | 2023-04-28 09:24:28.701258 |
updated_at | 2023-07-31 09:20:59.79115 |
description | a fast BPE tokeniser for use with OpenAI's models |
homepage | |
repository | https://github.com/darknight/tiktoken-rust |
max_upload_size | |
id | 851263 |
size | 71,358 |
STATUS: Under development.
tiktoken is a fast BPE tokeniser for use with OpenAI's models. It provides Python interface to interact with it.
This project is a fork of original repo, bring the capability to rust world.
use tiktoken_rust as tt;
let enc = tt::get_encoding("cl100k_base").unwrap();
assert_eq!(
"hello world",
enc.decode(&enc.encode_ordinary("hello world"), tt::DecodeMode::Strict).unwrap()
)