Downloads · 30 days
0
LnL-AI/dbrx-base-tokenizer
dbrx-base-tokenizer is a machine learning model from LnL-AI. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
1. This tokenizer is validated with the https://huggingface.co/datasets/xn (all languages) to be encode/decode compatible with dbrx-base tiktoken 2. Original tokenizer pad the vocabulary to correct size with <extraN t…
Downloads · 30 days
0
Access
Public
Updated Apr 4, 2024
Repo size
38.7 MB
Likes
0
Public
Click a slice to open those files.
.json6.3 MB · 87%
From the Hugging Face model README
<extra_N> tokens but encoder never uses themmodified from original code @ https://huggingface.co/Xenova/dbrx-instruct-tokenizer
Changes:
1. Remove non-base model tokens
2. Keep/Add `<|pad|>` special token to make sure padding can be differentiated from eos/bos.
3. Expose 15 unused/reserved `<|extra_N|>` for use
# pad token
"100256": {
"content": "<|pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
# 15 unused/reserved extra tokens
"<|extra_0|>": 100261
"<|extra_1|>": 100262
...
"<|extra_14|>": 100275
A 🤗-compatible version of the DBRX Instruct (adapted from databricks/dbrx-instruct). This means it can be used with Hugging Face libraries including Transformers, Tokenizers, and Transformers.js.
from transformers import GPT2TokenizerFast
tokenizer = GPT2TokenizerFast.from_pretrained('Xenova/dbrx-instruct-tokenizer')
assert tokenizer.encode('hello world') == [15339, 1917]
import { AutoTokenizer } from '@xenova/transformers';
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/dbrx-instruct-tokenizer');
const tokens = tokenizer.encode('hello world'); // [15339, 1917]