chef-gpt-en

Test the model HERE.

Fine-tuned GPT-2 for recipe generation. This is the dataset that it's trained on.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer


MODEL_ID = "auhide/chef-gpt-en"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
chef_gpt = AutoModelForCausalLM.from_pretrained(MODEL_ID)

ingredients = ", ".join([
    "spaghetti",
    "tomatoes",
    "basel",
    "salt",
    "chicken",
])
prompt = f"ingredients>> {ingredients}; recipe>>"
tokens = chef_gpt.tokenizer(prompt, return_tensors="pt")

recipe = chef_gpt.generate(**tokens, max_length=124)
print(recipe)

Here is a sample result of the prompt:

ingredients>> spaghetti, tomatoes, basel, salt, chicken; recipe>>cook spaghetti according to package directions
meanwhile, place tomato slices and basel in a large pot with salted water and bring to a boil
reduce heat and
Downloads last month
198
Safetensors
Model size
124M params
Tensor type
F32
·
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.

Space using auhide/chef-gpt-en 1