Text Classification
Transformers
PyTorch
English
distilbert
text-classfication
nlp
neural-compressor
PostTrainingDynamic
int8
Intel® Neural Compressor
text-embeddings-inference
Instructions to use Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc") model = AutoModelForSequenceClassification.from_pretrained("Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc/resolve/1ffbb821421cc4b3a820f356621e3f0d0ac38b7e/README.md
- Command line
-
hf download hf://Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc@1ffbb821421cc4b3a820f356621e3f0d0ac38b7e/README.md
-
curl -L -o README.md https://huggingface.co/Intel/distilbert-base-uncased-MRPC-int8-dynamic-inc/resolve/1ffbb821421cc4b3a820f356621e3f0d0ac38b7e/README.md
1.54 kB
| language: en | |
| license: mit | |
| datasets: | |
| - glue | |
| - mrpc | |
| metrics: | |
| - f1 | |
| tags: | |
| - text-classfication | |
| - nlp | |
| - neural-compressor | |
| - PostTrainingDynamic | |
| - int8 | |
| - Intel® Neural Compressor | |
| # Dynamically quantized DistilBERT base uncased finetuned MPRC | |
| ## Table of Contents | |
| - [Model Details](#model-details) | |
| - [How to Get Started With the Model](#how-to-get-started-with-the-model) | |
| ## Model Details | |
| **Model Description:** This model is a [DistilBERT](https://huggingface.co/textattack/distilbert-base-uncased-MRPC) fine-tuned on MPRC dynamically quantized with [optimum-intel](https://github.com/huggingface/optimum-intel) through the usage of [huggingface/optimum-intel](https://github.com/huggingface/optimum-intel) through the usage of [Intel® Neural Compressor](https://github.com/intel/neural-compressor). | |
| - **Model Type:** Text Classification | |
| - **Language(s):** English | |
| - **License:** Apache-2.0 | |
| - **Parent Model:** For more details on the original model, we encourage users to check out [this](https://huggingface.co/textattack/distilbert-base-uncased-MRPC) model card. | |
| ## How to Get Started With the Model | |
| ### PyTorch | |
| To load the quantized model, you can do as follows: | |
| ```python | |
| from optimum.intel.neural_compressor.quantization import IncQuantizedModelForSequenceClassification | |
| model = IncQuantizedModelForSequenceClassification.from_pretrained("Intel/distilbert-base-uncased-MRPC-int8-dynamic") | |
| ``` | |
| #### Test result | |
| | |INT8|FP32| | |
| |---|:---:|:---:| | |
| | **Accuracy (eval-f1)** |0.8983|0.9027| | |
| | **Model size (MB)** |75|268| | |