BPE Encoder Decoder for GPT-3 implemented in native Elixir.
The package can be installed
by adding gpt3_tokenizer
to your list of dependencies in mix.exs
:
def deps do
[
{:gpt3_tokenizer, "~> 0.1.0"}
]
end
Gpt3Tokenizer.encode("hello 👋 world 🌍")
Gpt3Tokenizer.decode([31373, 50169, 233, 995, 12520, 234, 235])
Gpt3Tokenizer.token_count("This sentence is 6 tokens long")
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/gpt3_tokenizer.