Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- transformers.js
|
5 |
+
- tokenizers
|
6 |
+
---
|
7 |
+
|
8 |
+
# Nemotron-4-340B-Instruct Tokenizer
|
9 |
+
|
10 |
+
A 🤗-compatible version of the **Nemotron-4-340B-Instruct** (adapted from [nvidia/Nemotron-4-340B-Instruct](https://huggingface.co/nvidia/Nemotron-4-340B-Instruct)). This means it can be used with Hugging Face libraries including [Transformers](https://github.com/huggingface/transformers), [Tokenizers](https://github.com/huggingface/tokenizers), and [Transformers.js](https://github.com/xenova/transformers.js).
|
11 |
+
|
12 |
+
## Example usage:
|
13 |
+
|
14 |
+
### Transformers/Tokenizers
|
15 |
+
```py
|
16 |
+
from transformers import PreTrainedTokenizerFast
|
17 |
+
|
18 |
+
tokenizer = PreTrainedTokenizerFast.from_pretrained('Xenova/Nemotron-4-340B-Instruct-Tokenizer')
|
19 |
+
assert tokenizer.encode('hello world') == [38150, 2268]
|
20 |
+
```
|
21 |
+
|
22 |
+
### Transformers.js
|
23 |
+
```js
|
24 |
+
import { AutoTokenizer } from '@xenova/transformers';
|
25 |
+
|
26 |
+
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/Nemotron-4-340B-Instruct-Tokenizer');
|
27 |
+
const tokens = tokenizer.encode('hello world'); // [38150, 2268]
|
28 |
+
```
|