Instructions to use optimum-internal-testing/tiny_random_bert_neuronx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use optimum-internal-testing/tiny_random_bert_neuronx with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="optimum-internal-testing/tiny_random_bert_neuronx")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("optimum-internal-testing/tiny_random_bert_neuronx") model = AutoModel.from_pretrained("optimum-internal-testing/tiny_random_bert_neuronx", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload config.json with huggingface_hub
Browse files- config.json +9 -1
config.json
CHANGED
|
@@ -17,17 +17,25 @@
|
|
| 17 |
"auto_cast_type": null,
|
| 18 |
"compiler_type": "neuronx-cc",
|
| 19 |
"compiler_version": "2.21.18209.0+043b1bf7",
|
|
|
|
| 20 |
"disable_fallback": false,
|
| 21 |
"disable_fast_relayout": false,
|
| 22 |
"dynamic_batch_size": false,
|
| 23 |
"float_dtype": "fp32",
|
| 24 |
"inline_weights_to_neff": true,
|
| 25 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
"int_dtype": "int64",
|
| 27 |
"model_type": "bert",
|
| 28 |
"optlevel": "2",
|
| 29 |
"output_attentions": false,
|
| 30 |
"output_hidden_states": false,
|
|
|
|
|
|
|
|
|
|
| 31 |
"static_batch_size": 1,
|
| 32 |
"static_sequence_length": 32,
|
| 33 |
"task": "text-classification",
|
|
|
|
| 17 |
"auto_cast_type": null,
|
| 18 |
"compiler_type": "neuronx-cc",
|
| 19 |
"compiler_version": "2.21.18209.0+043b1bf7",
|
| 20 |
+
"cpu_backend": false,
|
| 21 |
"disable_fallback": false,
|
| 22 |
"disable_fast_relayout": false,
|
| 23 |
"dynamic_batch_size": false,
|
| 24 |
"float_dtype": "fp32",
|
| 25 |
"inline_weights_to_neff": true,
|
| 26 |
+
"input_names": [
|
| 27 |
+
"input_ids",
|
| 28 |
+
"attention_mask",
|
| 29 |
+
"token_type_ids"
|
| 30 |
+
],
|
| 31 |
"int_dtype": "int64",
|
| 32 |
"model_type": "bert",
|
| 33 |
"optlevel": "2",
|
| 34 |
"output_attentions": false,
|
| 35 |
"output_hidden_states": false,
|
| 36 |
+
"output_names": [
|
| 37 |
+
"logits"
|
| 38 |
+
],
|
| 39 |
"static_batch_size": 1,
|
| 40 |
"static_sequence_length": 32,
|
| 41 |
"task": "text-classification",
|