Spaces:
Sleeping
Sleeping
File size: 1,396 Bytes
848cecc 29e2e4b 03c4b57 29e2e4b f6274df 6941f28 03c4b57 29e2e4b 03c4b57 c4af427 29e2e4b 03c4b57 29e2e4b 03c4b57 29e2e4b 03c4b57 29e2e4b 03c4b57 29e2e4b 03c4b57 29e2e4b 03c4b57 29e2e4b 03c4b57 76a90fe 29e2e4b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | import streamlit as st
from model_api import query_model
from prompt_builder import build_prompt
st.title("🏋️ AI Personalized 5-Day Workout Planner")
if "logged_in" not in st.session_state:
st.session_state.logged_in = False
if not st.session_state.logged_in:
st.warning("Please login first")
st.stop()
name = st.text_input("Name")
age = st.number_input("Age", 10, 80)
gender = st.selectbox("Gender", ["Male", "Female", "Other"])
height = st.number_input("Height (cm)", 100, 250)
weight = st.number_input("Weight (kg)", 30, 200)
goal = st.selectbox(
"Fitness Goal",
["Build Muscle", "Weight Loss", "Strength Gain", "Abs Building", "Flexibility"]
)
fitness_level = st.selectbox(
"Fitness Level",
["Beginner", "Intermediate", "Advanced"]
)
equipment = st.multiselect(
"Equipment",
[
"Dumbbells",
"Resistance Band",
"Yoga Mat",
"Skipping Rope",
"Pullups Bar",
"Inclined Bench",
"Weight Plates"
]
)
if st.button("Generate 5-Day Plan 💪"):
prompt, bmi, bmi_status = build_prompt(
name, age, gender, height, weight,
goal, fitness_level, equipment
)
st.subheader(f"BMI: {bmi} ({bmi_status})")
with st.spinner("Generating workout plan..."):
result = query_model(prompt)
st.markdown("## 🗓️ Your 5-Day Workout Plan")
st.markdown(result) |