Instructions to use the-hir0/t5-small-detoxify with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use the-hir0/t5-small-detoxify with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("the-hir0/t5-small-detoxify") model = AutoModelForSeq2SeqLM.from_pretrained("the-hir0/t5-small-detoxify") - Notebooks
- Google Colab
- Kaggle
Text Detoxification Task is a process of transforming the text with toxic style into the text with the same meaning but with neutral style
import torch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
device = 'cuda' if torch.cuda.is_available() else 'cpu'
tokenizer = AutoTokenizer.from_pretrained("the-hir0/t5-small-detoxify")
model = AutoModelForSeq2SeqLM.from_pretrained("the-hir0/t5-small-detoxify").to(device)
input_ids = tokenizer(inference_request, return_tensors="pt", padding=True).input_ids.to(device)
outputs = model.generate(input_ids=input_ids)
tokenizer.batch_decode(outputs, skip_special_tokens=True,temperature=0)
- Downloads last month
- 4
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support