Text Generation
PEFT
Safetensors
English
mistral
qlora
lora
sft
recipe-generation
nutrition
fine-tuned
unsloth
Instructions to use paulaschez/Mistral-7B-AI-Chef with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use paulaschez/Mistral-7B-AI-Chef with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/mistral-7b-bnb-4bit") model = PeftModel.from_pretrained(base_model, "paulaschez/Mistral-7B-AI-Chef") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use paulaschez/Mistral-7B-AI-Chef with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for paulaschez/Mistral-7B-AI-Chef to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for paulaschez/Mistral-7B-AI-Chef to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for paulaschez/Mistral-7B-AI-Chef to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="paulaschez/Mistral-7B-AI-Chef", max_seq_length=2048, )
metadata
base_model: mistralai/Mistral-7B-v0.1
base_model_relation: adapter
license: apache-2.0
language:
- en
library_name: peft
tags:
- mistral
- qlora
- lora
- sft
- recipe-generation
- nutrition
- fine-tuned
- unsloth
pipeline_tag: text-generation
datasets:
- Shengtao/recipe
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
| Field | Value |
|---|---|
| Base model | mistralai/Mistral-7B-v0.1 |
| Fine-tuning technique | QLoRA (4-bit NF4 + LoRA) |
| LoRA rank (r) | 16 |
| LoRA alpha | 16 |
| Target modules | q, k, v, o, gate, up, down proj |
| Trainable parameters | 41,943,040 (0.58% of total) |
| Training examples | 3,000 |
| Epochs | 1 |
| Final eval loss | 0.454 |
| Training tool | Unsloth 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
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