Run this model with HF Jobs

Run minuva/MiniLMv2-toxic-jigsaw on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/minuva/MiniLMv2-toxic-jigsaw. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/minuva/MiniLMv2-toxic-jigsaw on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="minuva/MiniLMv2-toxic-jigsaw")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("minuva/MiniLMv2-toxic-jigsaw")
model = AutoModelForSequenceClassification.from_pretrained("minuva/MiniLMv2-toxic-jigsaw", device_map="auto")
Quick Links

Text Classification GoEmotions

This model is a fined-tuned version of MiniLMv2-L6-H384 on the on the Jigsaw 1st Kaggle competition dataset using unitary/toxic-bert as teacher model. The quantized version in ONNX format can be found here.

The model with two labels only (toxicity and severe toxicity) is here

Load the Model

from transformers import pipeline

pipe = pipeline(model='minuva/MiniLMv2-toxic-jigsaw', task='text-classification')
pipe("This is pure trash")
# [{'label': 'toxic', 'score': 0.9383478164672852}]

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 6e-05
  • train_batch_size: 48
  • eval_batch_size: 48
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 10
  • warmup_ratio: 0.1

Metrics (comparison with teacher model)

Teacher (params) Student (params) Set (metric) Score (teacher) Score (student)
unitary/toxic-bert (110M) MiniLMv2-toxic-jigsaw (23M) Test (ROC_AUC) 0.98636 0.98600

Deployment

Check out fast-nlp-text-toxicity repository for a FastAPI based server to deploy this model in CPU devices.

Downloads last month
228
Safetensors
Model size
22.7M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Collection including minuva/MiniLMv2-toxic-jigsaw