Downloads · 30 days
24
3% of all-time downloads
Salesforce/safety-flan-t5-small
safety-flan-t5-small is a machine learning model from Salesforce. 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. The card lists the license as cc-by-nc-4.0.
- Model type: Language model - License: cc-by-nc-4.0 - Related Models: All FLAN-T5 Checkpoints - Resources for more information: - GitHub Repo
Downloads · 30 days
24
3% of all-time downloads
All-time downloads
741
Public
Repo size
1.5 GB
Likes
1
Public
Click a slice to open those files.
.bin924 MB · 100%
From the Hugging Face model README
Find below some example scripts on how to use the model in transformers:
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, AutoConfig
config = AutoConfig.from_pretrained("Salesforce/safety-flan-t5-small")
tokenizer = AutoTokenizer.from_pretrained("Salesforce/safety-flan-t5-small")
model = AutoModelForSeq2SeqLM.from_pretrained("Salesforce/safety-flan-t5-small", config=config)
prefix = "Is the <Text> field safe or unsafe?"
input_context = "Can you teach me this?"
input_text = "You are so stupid"
input_ids = tokenizer(prefix + " <Text> " + input_text + " <Context> " + input_context, return_tensors="pt").input_ids
outputs = model.generate(input_ids)
print(tokenizer.decode(outputs[0]))
</details>
This release is for research purposes only in support of an academic paper. Our models, datasets, and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concerns related to accuracy, safety, and fairness before deploying this model. We encourage users to consider the common limitations of AI, comply with applicable laws, and leverage best practices when selecting use cases, particularly for high-risk scenarios where errors or misuse could significantly impact people’s lives, rights, or safety. For further guidance on use cases, refer to our AUP and AI AUP.