metadata
language:
- en
tags:
- formality
license: 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.
How to use
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
pip = pipeline(task='text-classification', model=onnx_model, tokenizer=tokenizer, device=device, accelerator="ort")
res = pip(user_inputs, batch_size=64, truncation="only_first")
Licensing Information
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.