import tempfile

from tokenizers import Tokenizer, models
from transformers import PreTrainedTokenizerFast

model_max_length = 4
vocab = [(chr(i), i) for i in range(256)]
tokenizer = Tokenizer(models.Unigram(vocab))
with tempfile.NamedTemporaryFile() as f:
    real_tokenizer = PreTrainedTokenizerFast(, model_max_length=model_max_length)"dummy/tokenizer.json")

config uses Albert which works with a minimal config.json

Downloads last month
Hosted inference API

Unable to determine this model’s pipeline type. Check the docs .