Text Classification
Transformers
PyTorch
ONNX
English
bert
text-classfication
int8
Intel® Neural Compressor
neural-compressor
PostTrainingStatic
text-embeddings-inference
Instructions to use INC4AI/bert-base-uncased-mrpc-int8-static-inc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use INC4AI/bert-base-uncased-mrpc-int8-static-inc with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="INC4AI/bert-base-uncased-mrpc-int8-static-inc")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("INC4AI/bert-base-uncased-mrpc-int8-static-inc") model = AutoModelForSequenceClassification.from_pretrained("INC4AI/bert-base-uncased-mrpc-int8-static-inc") - Notebooks
- Google Colab
- Kaggle
update loading instructions
Browse files
README.md
CHANGED
|
@@ -37,10 +37,10 @@ The linear module **bert.encoder.layer.9.output.dense** falls back to fp32 to me
|
|
| 37 |
#### Load with Intel® Neural Compressor:
|
| 38 |
|
| 39 |
```python
|
| 40 |
-
from optimum.intel
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
)
|
| 44 |
```
|
| 45 |
|
| 46 |
### ONNX
|
|
@@ -65,4 +65,4 @@ The calibration dataloader is the eval dataloader. The calibration sampling size
|
|
| 65 |
```python
|
| 66 |
from optimum.onnxruntime import ORTModelForSequenceClassification
|
| 67 |
model = ORTModelForSequenceClassification.from_pretrained('Intel/bert-base-uncased-mrpc-int8-static')
|
| 68 |
-
```
|
|
|
|
| 37 |
#### Load with Intel® Neural Compressor:
|
| 38 |
|
| 39 |
```python
|
| 40 |
+
from optimum.intel import INCModelForSequenceClassification
|
| 41 |
+
|
| 42 |
+
model_id = "Intel/bert-base-uncased-mrpc-int8-static"
|
| 43 |
+
int8_model = INCModelForSequenceClassification.from_pretrained(model_id)
|
| 44 |
```
|
| 45 |
|
| 46 |
### ONNX
|
|
|
|
| 65 |
```python
|
| 66 |
from optimum.onnxruntime import ORTModelForSequenceClassification
|
| 67 |
model = ORTModelForSequenceClassification.from_pretrained('Intel/bert-base-uncased-mrpc-int8-static')
|
| 68 |
+
```
|