Downloads · 30 days
14
15% of all-time downloads
RaghavM12/gpt-oss-20b-rutgers-mealplan
gpt-oss-20b-rutgers-mealplan is a text generation model from RaghavM12. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
A specialized LoRA adapter for the GPT-OSS model, fine-tuned for Rutgers dining hall meal planning. This model generates personalized meal plans with specific calorie and protein targets based on available menu items.
Downloads · 30 days
14
15% of all-time downloads
All-time downloads
95
Public
Repo size
59.7 MB
Likes
0
Public
Click a slice to open those files.
.safetensors31.9 MB · 53%
From the Hugging Face model README
A specialized LoRA adapter for the GPT-OSS model, fine-tuned for Rutgers dining hall meal planning. This model generates personalized meal plans with specific calorie and protein targets based on available menu items.
pip install unsloth transformers peft torch
from unsloth import FastLanguageModel
from peft import PeftModel
# Load base model
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/gpt-oss-20b",
max_seq_length=1024,
dtype=None,
load_in_4bit=True,
attn_implementation="eager",
)
# Load LoRA adapter
model = PeftModel.from_pretrained(model, "RaghavM12/gpt-oss-20b-rutgers-mealplan")
# Set to inference mode
FastLanguageModel.for_inference(model)
# Generate meal plan
prompt = "You are a Rutgers dining hall meal planning assistant. Based on today's menu, create a personalized meal plan (breakfast, lunch, dinner) that targets about 2000 calories and 120 grams of protein. Show nutrition per item and totals."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.1)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
prompt = "Create a meal plan for 2000 calories and 120g protein"
# Returns: {"breakfast": [...], "lunch": [...], "dinner": [...], "totals": {"calories": 2000, "protein": 120}}
prompt = "Create a vegetarian meal plan for 1800 calories and 100g protein"
# Returns personalized vegetarian meal plan
prompt = "Based on this menu: [menu items], create a meal plan for 2200 calories and 140g protein"
# Returns meal plan using specific menu items
adapter_config.json: LoRA configurationadapter_model.safetensors: LoRA weights (~50MB)tokenizer_config.json: Tokenizer configurationtokenizer.json: Tokenizer vocabularyREADME.md: This documentationfrom transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("unsloth/gpt-oss-20b")
tokenizer = AutoTokenizer.from_pretrained("unsloth/gpt-oss-20b")
model = PeftModel.from_pretrained(base_model, "RaghavM12/gpt-oss-20b-rutgers-mealplan")
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.1, # Lower for more consistent outputs
do_sample=True,
top_p=0.9, # Nucleus sampling
repetition_penalty=1.1 # Reduce repetition
)
The model was trained on 6000 meal planning examples including:
This is a LoRA adapter that modifies the attention layers of the base GPT-OSS model:
The model was evaluated on a test set of 100 meal planning scenarios:
# Load model for local use
model = PeftModel.from_pretrained(base_model, "RaghavM12/gpt-oss-20b-rutgers-mealplan")
# Use with FastAPI or similar
from fastapi import FastAPI
app = FastAPI()
@app.post("/meal-plan")
async def generate_meal_plan(request: dict):
# Your meal planning logic here
return {"meal_plan": response}
Contributions are welcome! Areas for improvement:
This model is released under the Apache 2.0 License. See the LICENSE file for details.
For questions or issues:
Note: This model is specifically designed for Rutgers dining hall meal planning and may not generalize well to other contexts without additional fine-tuning.