Recipe GPT-2 LoRA Model

A fine-tuned GPT-2 model for recipe recommendations using LoRA (Low-Rank Adaptation).

Model Description

This model generates personalized recipe suggestions based on:

  • Available ingredients
  • Dietary preferences
  • Cooking time constraints
  • Cuisine preferences

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

# Load base model and tokenizer
base_model = AutoModelForCausalLM.from_pretrained("gpt2")
tokenizer = AutoTokenizer.from_pretrained("gpt2")

# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "nutrientartcd/recipe-gpt2-lora")

# Generate recipe suggestion
prompt = "User: I have chicken, garlic, rice. I'm looking for something ready in about 30 minutes.\nAssistant: "
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)

Training Data

Trained on a recipe dataset with user interactions and ratings, fine-tuned to provide conversational recipe recommendations.

Model Details

  • Base Model: GPT-2
  • Fine-tuning Method: LoRA (Low-Rank Adaptation)
  • Training Framework: Transformers + PEFT
  • Language: English
  • Task: Conversational recipe recommendation

Limitations

  • English language only
  • May generate fictional recipe names
  • Nutritional information not guaranteed to be accurate
  • Requires proper prompt format for optimal results

Prompt Format

The model expects prompts in this conversation format:

User: I have [ingredients]. I'm looking for something ready in about [time] minutes. Preferences: [preferences].
Assistant: 

Citation

If you use this model, please cite:

@misc{nutrient-recipe-gpt2-lora,
  title={Recipe GPT-2 LoRA Model},
  author={NutrientAI},
  year={2025},
  url={https://huggingface.co/nutrientartcd/recipe-gpt2-lora}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for nutrientartcd/recipe-gpt2-lora

Adapter
(1694)
this model