class

Tiktoken::Encoding

Inherits Reference < Object

Class methods

cl100k_base
Source
for_model(model_name : String)
Source
o200k_base
Source
o200k_harmony
Source
p50k_base
Source
p50k_edit
Source
r50k_base
Source

Instance methods

count(text : String, allowed_special : Set(String) = Set(String).new) : Int32
Source
count_ordinary(text : String) : Int32
Source
count_with_special_tokens(text : String) : Int32
Source
decode(tokens) : String
Source
decode_bytes(tokens) : Bytes
Source
encode(text : String, allowed_special : Set(String) = Set(String).new)
Source
encode_ordinary(text : String)
Source
encode_with_special_tokens(text : String)
Source
finalize
Source

Nested types