CoolFace
Modelpublic

paulaschez/Mistral-7B-AI-Chef

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
1likes5downloads
Model Card

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

FieldValue
Base modelmistralai/Mistral-7B-v0.1
Fine-tuning techniqueQLoRA (4-bit NF4 + LoRA)
LoRA rank (r)16
LoRA alpha16
Target modulesq, k, v, o, gate, up, down proj
Trainable parameters41,943,040 (0.58% of total)
Training examples3,000
Epochs1
Final eval loss0.454
Training toolUnsloth on Google Colab T4

Training Dataset

  • Dataset: Shengtao/recipe
  • 24,970 recipes after filtering (3,000 used for training)
  • Dietary labels (Vegan, Vegetarian, Gluten-Free) inferred heuristically

Usage

python
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