Downloads · 30 days
27
0% of all-time downloads
Salesforce/safety-flan-t5-base
safety-flan-t5-base 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.
- Model type: Language model - License: CC BY-NC - Related Models: All FLAN-T5 Checkpoints - Resources for more information: - GitHub Repo
Downloads · 30 days
27
0% of all-time downloads
All-time downloads
955K
Public
Repo size
5 GB
Likes
8
Public
Click a slice to open those files.
.bin3 GB · 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-base")
tokenizer = AutoTokenizer.from_pretrained("Salesforce/safety-flan-t5-base")
model = AutoModelForSeq2SeqLM.from_pretrained("Salesforce/safety-flan-t5-base", 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.