paulaschez/Mistral-7B-AI-Chef
15
AI Chef
Fine-tuned LoRA adapter of Mistral-7B-v0.1 specialized in culinary and nutritional recipe generation.
Given a list of available ingredients and dietary restrictions, the model generates a complete structured recipe including nutritional information (calories, protein, carbs, fat) and step-by-step instructions.
Model Details
Training Dataset
- Dataset: Shengtao/recipe
- 24,970 recipes after filtering (3,000 used for training)
- Dietary labels (Vegan, Vegetarian, Gluten-Free) inferred heuristically
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load base model + adapter
tokenizer = AutoTokenizer.from_pretrained("paulaschez/Mistral-7B-AI-Chef")
model = AutoModelForCausalLM.from_pretrained(
"mistralai/Mistral-7B-v0.1",
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(model, "paulaschez/Mistral-7B-AI-Chef")
# Example prompt
prompt = """[INST] You are AI Chef, an advanced culinary and nutrition assistant \
for SmartKitchen Solutions. Given a list of available ingredients and dietary \
restrictions, generate a complete, structured recipe with nutritional information.
Ingredients: eggs, tomato, onion, olive oil
Dietary Restrictions: no specific restrictions [/INST]"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=400, temperature=0.3)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))Limitations
- Dietary labels are inferred heuristically — not 100% accurate for complex cases
- Trained on 3,000 examples (subset of available data) due to compute constraints
- English only
