Model Details
Model Description
- Model type: Language model
- License: cc-by-nc-4.0
- Related Models: All FLAN-T5 Checkpoints
- Resources for more information:
Usage
Find below some example scripts on how to use the model in transformers
:
Using the Pytorch model
Running the model
Click to expand
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]))
Ethical Considerations
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.
- Downloads last month
- 3
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
the model is not deployed on the HF Inference API.