Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -128,77 +128,44 @@ if not st.session_state.logged_in:
|
|
| 128 |
# ๐ช WORKOUT GENERATOR PAGE
|
| 129 |
# =====================================================
|
| 130 |
|
| 131 |
-
st.
|
| 132 |
|
| 133 |
-
|
|
|
|
|
|
|
| 134 |
|
| 135 |
-
|
|
|
|
| 136 |
|
| 137 |
-
|
| 138 |
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
|
|
|
| 145 |
|
| 146 |
-
|
|
|
|
| 147 |
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
-
|
| 151 |
-
"Fitness Goal",
|
| 152 |
-
[
|
| 153 |
-
"Build Muscle",
|
| 154 |
-
"Weight Loss",
|
| 155 |
-
"Strength Gain",
|
| 156 |
-
"Abs Building",
|
| 157 |
-
"Flexibility"
|
| 158 |
-
]
|
| 159 |
-
)
|
| 160 |
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
[
|
| 164 |
-
"Beginner",
|
| 165 |
-
"Intermediate",
|
| 166 |
-
"Advanced"
|
| 167 |
-
]
|
| 168 |
-
)
|
| 169 |
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
[
|
| 173 |
-
"Dumbbells",
|
| 174 |
-
"Resistance Band",
|
| 175 |
-
"Yoga Mat",
|
| 176 |
-
"Skipping Rope",
|
| 177 |
-
"Pullups Bar",
|
| 178 |
-
"Inclined Bench",
|
| 179 |
-
"Weight Plates"
|
| 180 |
-
]
|
| 181 |
-
)
|
| 182 |
-
|
| 183 |
-
if st.button("Generate 5-Day Plan ๐ช"):
|
| 184 |
-
|
| 185 |
-
prompt, bmi, bmi_status = build_prompt(
|
| 186 |
-
name, age, gender,
|
| 187 |
-
height, weight,
|
| 188 |
-
goal, fitness_level,
|
| 189 |
-
equipment
|
| 190 |
-
)
|
| 191 |
-
|
| 192 |
-
st.subheader(f"๐ BMI: {bmi:.2f} ({bmi_status})")
|
| 193 |
-
|
| 194 |
-
with st.spinner("Generating your AI workout plan..."):
|
| 195 |
-
|
| 196 |
-
result = query_model(prompt)
|
| 197 |
-
|
| 198 |
-
st.markdown("## ๐๏ธ Your Workout Plan")
|
| 199 |
-
st.markdown(result)
|
| 200 |
-
|
| 201 |
-
st.markdown("</div>", unsafe_allow_html=True)
|
| 202 |
|
| 203 |
|
| 204 |
# ---------- LOGOUT ----------
|
|
|
|
| 128 |
# ๐ช WORKOUT GENERATOR PAGE
|
| 129 |
# =====================================================
|
| 130 |
|
| 131 |
+
st.title("๐๏ธ AI Personalized 5-Day Workout Planner")
|
| 132 |
|
| 133 |
+
name = st.text_input("Name")
|
| 134 |
+
age = st.number_input("Age", min_value=0, max_value=100)
|
| 135 |
+
gender = st.selectbox("Gender", ["Male", "Female", "Other"])
|
| 136 |
|
| 137 |
+
height = st.number_input("Height (cm)", min_value=0, max_value=250)
|
| 138 |
+
weight = st.number_input("Weight (kg)", min_value=0, max_value=200)
|
| 139 |
|
| 140 |
+
goal = st.selectbox("Fitness Goal",["Build Muscle", "Weight Loss", "Strength Gain", "Abs Building", "Flexible"])
|
| 141 |
|
| 142 |
+
fitness_level = st.selectbox("Fitness Level", [
|
| 143 |
+
"Beginner",
|
| 144 |
+
"Intermediate",
|
| 145 |
+
"Advanced"
|
| 146 |
+
])
|
| 147 |
|
| 148 |
+
equipment = st.multiselect(
|
| 149 |
+
"Available Equipment",
|
| 150 |
+
["Dumbbells", "Resistance Band", "Yoga Mat", "Skipping Rope",
|
| 151 |
+
"Weight Plates", "Cycling", "Inclined Bench", "Pullups Bar", "No Equipment"]
|
| 152 |
+
)
|
| 153 |
|
| 154 |
+
# ---------- GENERATE PLAN ----------
|
| 155 |
+
if st.button("Generate 5-Day Plan ๐ช"):
|
| 156 |
|
| 157 |
+
prompt, bmi, bmi_status = build_prompt(
|
| 158 |
+
name, age, gender, height, weight,
|
| 159 |
+
goal, fitness_level, equipment
|
| 160 |
+
)
|
| 161 |
|
| 162 |
+
st.subheader(f"Your BMI: {bmi:.2f} ({bmi_status})")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
+
with st.spinner("Creating your personalized workout plan..."):
|
| 165 |
+
result = query_model(prompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
|
| 167 |
+
st.markdown("## ๐๏ธ Your 5-Day Workout Plan")
|
| 168 |
+
st.write(result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
|
| 170 |
|
| 171 |
# ---------- LOGOUT ----------
|