Grok-1 Tokenizer
A π€-compatible version of the Grok-1 tokenizer (adapted from xai-org/grok-1). This means it can be used with Hugging Face libraries including Transformers, Tokenizers, and Transformers.js.
Example usage:
Transformers/Tokenizers
from transformers import LlamaTokenizerFast
tokenizer = LlamaTokenizerFast.from_pretrained('Xenova/grok-1-tokenizer')
assert tokenizer.encode('hello world') == [21560, 1135]
Transformers.js
import { AutoTokenizer } from '@xenova/transformers';
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/grok-1-tokenizer');
const tokens = tokenizer.encode('hello world'); // [21560, 1135]