Edit model card

T5-Reverse (T5R)

This model can generate prompts (instructions) for any text!

This model is an instruction-tuned version of google/flan-t5-base on alpaca dataset but in reverse format!

How to Use the Model

You can use the transformers library to load and utilize the T5-Reverse (T5R) model for generating prompts based on text. Here's an example of how to do it:

>>> # Import required libraries
>>> import torch
>>> from transformers import pipeline

>>> # Load the model and tokenizer using the pipeline from Hugging Face Hub
>>> inference = pipeline("text2text-generation", model="kargaranamir/T5R-base")

>>> # Example instruction and prompt
>>> sample = '''
>>> Instruction: X
>>> Output: 1- Base your meals on higher fibre starchy carbohydrates. 2- Eat lots of fruit and veg. 3- Eat more fish, including a portion of oily fish.
>>> What kind of instruction could this be the answer to?
>>> X:
>>> '''

>>> # Generate a response using the model
>>> res = inference(sample)

>>> # Print the generated response
>>> print(res)

[{'generated_text': 'Instruction: Generate three recommendations for a healthy diet.'}]

Citation

If you find this model/approach useful, make a link to the huggingface model.

Downloads last month
4
Safetensors
Model size
248M params
Tensor type
F32
·

Dataset used to train kargaranamir/T5R-base