Spaces:
Sleeping
Sleeping
from transformers import RobertaTokenizer, RobertaForSequenceClassification | |
# load tokenizer and model weights | |
tokenizer = RobertaTokenizer.from_pretrained('SkolkovoInstitute/roberta_toxicity_classifier') | |
model = RobertaForSequenceClassification.from_pretrained('SkolkovoInstitute/roberta_toxicity_classifier') | |
# prepare the input | |
batch = tokenizer.encode('you are amazing', return_tensors='pt') | |
# inference | |
model(batch) |