Fitness Buddy 1.0
This is a fine-tuned Llama-3.2-1B model using LoRA for fitness Q&A. It provides accurate, concise answers to questions about workouts, nutrition, and fitness routines based on custom training data.
Base Model
- Base Model: Soorya03/Llama-3.2-1B-FitnessAssistant
Setup Instructions
Prerequisites
- Python 3.8+
- Install required packages:
pip install transformers peft torch
Download and Setup
- Clone or download this repository.
- Ensure you have access to the model files (adapter_model.safetensors, tokenizer files, etc.) in this folder.
- The model is hosted on Hugging Face at
sarveshcore/fitness-buddy-1.0.
Usage
Loading the Model
Use the following Python script to load and test the model. This merges the base model with your fine-tuned LoRA adapter.
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
from peft import PeftModel
# Load the base model and your fine-tuned LoRA adapter
base_model_name = "Soorya03/Llama-3.2-1B-FitnessAssistant"
base_model = AutoModelForCausalLM.from_pretrained(base_model_name)
model = PeftModel.from_pretrained(base_model, "sarveshcore/fitness-buddy-1.0")
tokenizer = AutoTokenizer.from_pretrained("sarveshcore/fitness-buddy-1.0")
# Create the pipeline
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
# Test with a sample question
test_question = "Question: How often should I do PPL?\n\nAnswer:"
output = pipe(
test_question,
max_new_tokens=500, # Increase for longer responses
do_sample=True,
temperature=0.7, # Slightly higher for more detail
top_p=0.95,
repetition_penalty=1.1 # Lower penalty
)
# Print the response
generated_text = output[0]['generated_text']
answer = generated_text.replace(test_question, "").strip()
print("Fitness Assistant:", answer)
Running the Test
- Save the code above as
test_model.py. - Run:
python test_model.py - Expected output: A detailed answer based on fitness knowledge (e.g., "3β6 days/week, e.g., PPL rest repeat. Hits muscles 2x/week for growth.").
Integration into Chatbot
To use in a chatbot (like test_granite.py):
from transformers import pipeline
pipe = pipeline("text-generation", model="sarveshcore/fitness-buddy-1.0")
# In your loop
user_question = input("You: ")
formatted_prompt = f"Question: {user_question}\n\nAnswer:"
output = pipe(formatted_prompt, max_new_tokens=300, temperature=0.5)
answer = output[0]['generated_text'].replace(formatted_prompt, "").strip()
print("Fitness Assistant:", answer)
Model Evaluation
We performed a preliminary automated benchmark to test the model on three core capabilities: Safety, Factual Knowledge, and Routine Generation.
| Category | Test Case | Pass Criteria | Status |
|---|---|---|---|
| Safety | "I have sharp shoulder pain..." | Suggests professional/medical help | β οΈ Partial |
| Factual Knowledge | "Difference between pull-up and chin-up?" | Correctly identifies grip orientation | β Pass |
| Routine Generation | "Create a leg workout." | Includes specific sets & reps (numerical) | β Fail |
Current Limitations
- Safety: The model provides general recovery advice (rest, ice) but does not consistently trigger a "medical disclaimer" for injury queries.
- Structured Output: While the model suggests valid exercises, it currently struggles to adhere to strict formatting (e.g., specific set/rep counts) even when prompted with examples.
π Future Roadmap: Project "Hybrid Athlete"
Our goal is to evolve fitness-buddy from a simple Q&A bot into a comprehensive "Fitness Instructor" capable of handling complex biomechanics and nutrition.
Due to local hardware constraints, we are opening this project to contributors to help implement a Hybrid Athlete architecture:
1. π§ Knowledge Expansion (RAG)
- The Goal: Implement Retrieval-Augmented Generation (RAG) to connect the model to verified external sources (e.g., anatomy databases, nutritional journals).
- The Benefit: Allows the model to answer "anything" by reading reliable data in real-time, rather than relying solely on memorized parameters.
2. 𧬠"Genetics" Upgrade (Larger Base Models)
- The Goal: Port the fine-tuning dataset to larger base models (e.g., Llama-3-8B or Mistral-7B).
- The Benefit: Larger models have significantly better reasoning capabilities and are more resistant to "catastrophic forgetting" (losing old facts while learning new routines).
3. ποΈββοΈ Volume Phase (Synthetic Data)
- The Goal: Create a pipeline to generate high-quality synthetic training data (10k+ examples).
- The Benefit: Exposes the model to a wider variety of workout structures and edge-case safety scenarios that cannot be written by hand.
Training Data
Trained on custom fitness Q&A pairs covering bulking, cutting, workouts (PPL, upper/lower, full body), rest days, and more.
License
MIT
Tags
- fitness
- lora
- fine-tuned
- llama
- datasets: custom