Downloads · 30 days
11
1% of all-time downloads
marianna13/byt5-small-NSFW-image-urls
byt5-small-NSFW-image-urls is a machine learning model from marianna13. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
11
1% of all-time downloads
All-time downloads
841
Public
Repo size
2.4 GB
Likes
3
Public
Click a slice to open those files.
.bin1.2 GB · 100%
From the Hugging Face model README
from transformers import T5ForConditionalGeneration, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("google/byt5-small")
model = T5ForConditionalGeneration.from_pretrained("marianna13/byt5-small-NSFW-image-urls")
def get_label(text):
input_ids = tokenizer(text, return_tensors="pt", padding=True).input_ids
outputs = model.generate(input_ids)
label = tokenizer.batch_decode(outputs, skip_special_tokens=True)
return label