Domain-general BPE tokenizer trained from scratch on 3.96 million documents
spanning natural language, code, mathematics, and scientific text.
1from transformers import AutoTokenizer
2
3tokenizer = AutoTokenizer.from_pretrained("Nj-1111/Copernicus-Tokenizer")
4
5ids = tokenizer("Hello, world!")
6print(ids)
1from transformers import PreTrainedTokenizerFast
2
3tokenizer = PreTrainedTokenizerFast.from_pretrained("Nj-1111/Copernicus-Tokenizer")
4
5inputs = tokenizer(
6 ["Hello world", "def foo(): pass"],
7 truncation=True,
8 max_length=2048,
9 padding="max_length",
10 return_tensors="pt",
11)