t5 recipe generation
flax-communityIntroduction
The T5 Recipe Generation model, also known as Chef Transformer, is a text-to-text generation model developed during the Flax/Jax Community Week by Hugging Face, with TPU support from Google. It generates cooking recipes based on given ingredients.
Architecture
The model is based on the T5 architecture, which is a Transformer model designed for text-to-text tasks. It supports several frameworks including PyTorch, TensorFlow, and JAX, and provides tools like TensorBoard for visualization. The model is optimized for generating sequences, specifically tailored for recipe generation.
Training
The model was trained on the RecipeNLG dataset, which includes over 2 million cooking recipes. The training process involved using specific hyperparameters for sequence generation tasks, such as controlling maximum and minimum length, beam search, and sampling strategies.
Guide: Running Locally
Basic Steps
-
Install Dependencies:
pip install transformers
-
Load the Model:
from transformers import FlaxAutoModelForSeq2SeqLM, AutoTokenizer MODEL_NAME_OR_PATH = "flax-community/t5-recipe-generation" tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME_OR_PATH, use_fast=True) model = FlaxAutoModelForSeq2SeqLM.from_pretrained(MODEL_NAME_OR_PATH)
-
Generate Recipes:
Use thegeneration_function
to input ingredients and generate recipes.
Cloud GPUs
For enhanced performance, especially for large datasets or complex generation tasks, consider using cloud GPUs from providers like Google Cloud, AWS, or Azure.
License
The T5 Recipe Generation model and related resources are provided with gratitude to contributors and partners, including anatomy icons from Flaticon, Chef Hat from Vecteezy, and various other resources. The model's usage is subject to the licenses of these contributing works.