Jingya HF Staff commited on
Commit
41a0b6d
·
verified ·
1 Parent(s): 335766f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -0
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
+ ```