Downloads · 30 days
7
0% of all-time downloads
Deepchecks/roberta_base_formality_ranker_onnx
roberta_base_formality_ranker_onnx is a text classification model from Deepchecks. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc-by-nc-sa-4.0.
This model represents an ONNX-optimized version of the original roberta-base-formality-ranker model. It has been specifically tailored for GPUs and may exhibit variations in performance when run on CPUs.
Downloads · 30 days
7
0% of all-time downloads
All-time downloads
13.6K
Public
Repo size
260 MB
Likes
0
Public
Click a slice to open those files.
.onnx260 MB · 99%
From the Hugging Face model README
This model represents an ONNX-optimized version of the original roberta-base-formality-ranker model. It has been specifically tailored for GPUs and may exhibit variations in performance when run on CPUs.
Please install the following dependency before you begin working with the model:
pip install optimum[onnxruntime-gpu]
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSequenceClassification
from optimum.pipelines import pipeline
# load tokenizer and model weights
tokenizer = AutoTokenizer.from_pretrained('Deepchecks/roberta_base_formality_ranker_onnx')
model = ORTModelForSequenceClassification.from_pretrained('Deepchecks/roberta_base_formality_ranker_onnx')
# prepare the pipeline and generate inferences
user_inputs = ["I hope this email finds you well", "I hope this email find you swell", "What's up doc?"]
pip = pipeline(task='text-classification', model=model, tokenizer=tokenizer, device=device, accelerator="ort")
res = pip(user_inputs, batch_size=64, truncation="only_first")
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.