File size: 743 Bytes
b014b3b
 
 
 
 
 
86b2f2f
b014b3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
license: apache-2.0
---

Upstage `solar-pro` tokenizer
- Vocab size: 64,000
- Langauge support: English, Korean and more

Please use this tokenizer for tokenizing inputs for the Upstage [solar-pro](https://developers.upstage.ai/docs/apis/chat) model.

You can load it with the tokenizer library like this:

```python
from tokenizers import Tokenizer

tokenizer = Tokenizer.from_pretrained("upstage/solar-pro-tokenizer")
text = "Hi, how are you?"
enc = tokenizer.encode(text)
print("Encoded input:")
print(enc)

inv_vocab = {v: k for k, v in tokenizer.get_vocab().items()}
tokens = [inv_vocab[token_id] for token_id in enc.ids]
print("Tokens:")
print(tokens)

number_of_tokens = len(enc.ids)
print("Number of tokens:", number_of_tokens)
```