Jingya HF Staff commited on
Commit
b74f04e
·
verified ·
1 Parent(s): a4a2af9

Update README.md

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