Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,26 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
|
5 |
+
**INFERENTIA ONLY**
|
6 |
+
|
7 |
+
```py
|
8 |
+
|
9 |
+
from transformers import AutoTokenizer
|
10 |
+
from optimum.neuron import NeuronBertForTokenClassification
|
11 |
+
|
12 |
+
input_shapes = {"batch_size": 1, "sequence_length": 128}
|
13 |
+
compiler_args = {"auto_cast": "matmul", "auto_cast_type": "bf16"}
|
14 |
+
neuron_model = NeuronBertForTokenClassification.from_pretrained(
|
15 |
+
"dslim/bert-base-NER",
|
16 |
+
export=True,
|
17 |
+
**input_shapes,
|
18 |
+
**compiler_args,
|
19 |
+
)
|
20 |
+
# Save locally
|
21 |
+
neuron_model.save_pretrained("bert_base_ner_neuronx")
|
22 |
+
neuron_model.push_to_hub(
|
23 |
+
"bert_base_ner_neuronx",
|
24 |
+
repository_id="optimum/bert-base-NER-neuronx", # Replace with your HF Hub repo id
|
25 |
+
)
|
26 |
+
```
|