tweets-hate-speech-detection/tweets_hate_speech_detection
Viewer โข Updated โข 49.2k โข 559 โข 18
How to use mrm8488/distilroberta-finetuned-tweets-hate-speech with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="mrm8488/distilroberta-finetuned-tweets-hate-speech") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("mrm8488/distilroberta-finetuned-tweets-hate-speech")
model = AutoModelForSequenceClassification.from_pretrained("mrm8488/distilroberta-finetuned-tweets-hate-speech", device_map="auto")