srbhavya01 commited on
Commit
c4af427
·
verified ·
1 Parent(s): 23ecc52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -17
app.py CHANGED
@@ -1,37 +1,41 @@
1
  import streamlit as st
2
- from huggingface_hub import InferenceClient
3
- import os
4
 
5
- # ---------- STREAMLIT UI ----------
 
 
 
 
 
6
  st.title("🏋️ AI Personalized 5-Day Workout Planner")
7
 
 
8
  name = st.text_input("Name")
9
  gender = st.selectbox("Gender", ["Male", "Female", "Other"])
 
10
  height = st.number_input("Height (cm)", min_value=100, max_value=250)
11
  weight = st.number_input("Weight (kg)", min_value=30, max_value=200)
12
 
13
- goal = st.selectbox("Fitness Goal", [
14
- "Weight Loss",
15
- "Muscle Gain",
16
- "General Fitness",
17
- "Strength"
18
- ])
19
 
20
- fitness_level = st.selectbox("Fitness Level", [
21
- "Beginner",
22
- "Intermediate",
23
- "Advanced"
24
- ])
25
 
26
  equipment = st.multiselect(
27
  "Available Equipment",
28
  ["Dumbbells", "Barbell", "Resistance Bands", "Kettlebell", "No Equipment"]
29
  )
30
 
 
31
  if st.button("Generate 5-Day Plan 💪"):
32
 
33
  prompt, bmi, bmi_status = build_prompt(
34
- name, gender, height, weight, goal, fitness_level, equipment
 
35
  )
36
 
37
  st.subheader(f"Your BMI: {bmi:.2f} ({bmi_status})")
@@ -39,5 +43,5 @@ if st.button("Generate 5-Day Plan 💪"):
39
  with st.spinner("Creating your personalized workout plan..."):
40
  result = query_model(prompt)
41
 
42
- st.markdown("## 🗓️ Your 5-Day Workout Plan")
43
- st.write(result)
 
1
  import streamlit as st
 
 
2
 
3
+ # IMPORT your existing functions
4
+ from model.query_model import query_model
5
+ from utils.prompt_builder import build_prompt
6
+
7
+ st.set_page_config(page_title="AI Workout Planner", layout="centered")
8
+
9
  st.title("🏋️ AI Personalized 5-Day Workout Planner")
10
 
11
+ # ---------- USER INPUT ----------
12
  name = st.text_input("Name")
13
  gender = st.selectbox("Gender", ["Male", "Female", "Other"])
14
+
15
  height = st.number_input("Height (cm)", min_value=100, max_value=250)
16
  weight = st.number_input("Weight (kg)", min_value=30, max_value=200)
17
 
18
+ goal = st.selectbox(
19
+ "Fitness Goal",
20
+ ["Weight Loss", "Muscle Gain", "General Fitness", "Strength"]
21
+ )
 
 
22
 
23
+ fitness_level = st.selectbox(
24
+ "Fitness Level",
25
+ ["Beginner", "Intermediate", "Advanced"]
26
+ )
 
27
 
28
  equipment = st.multiselect(
29
  "Available Equipment",
30
  ["Dumbbells", "Barbell", "Resistance Bands", "Kettlebell", "No Equipment"]
31
  )
32
 
33
+ # ---------- GENERATE PLAN ----------
34
  if st.button("Generate 5-Day Plan 💪"):
35
 
36
  prompt, bmi, bmi_status = build_prompt(
37
+ name, gender, height, weight,
38
+ goal, fitness_level, equipment
39
  )
40
 
41
  st.subheader(f"Your BMI: {bmi:.2f} ({bmi_status})")
 
43
  with st.spinner("Creating your personalized workout plan..."):
44
  result = query_model(prompt)
45
 
46
+ st.markdown("## 🏋️ Your Personalized Workout Plan")
47
+ st.markdown(result)