Harry2406 commited on
Commit
8ec3d26
·
verified ·
1 Parent(s): 36906ac

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +34 -36
src/streamlit_app.py CHANGED
@@ -121,45 +121,43 @@ if st.button("Submit Profile"):
121
  equipment_list = ", ".join(equipment)
122
 
123
  prompt = f"""
124
- You are a certified professional fitness trainer.
 
125
 
126
- Generate a structured 5-day workout plan based on the following user profile.
127
 
128
- User Profile:
129
  - Gender: {gender}
130
  - BMI: {bmi:.2f} ({bmi_status})
131
- - Goal: {fitness_goal}
132
  - Fitness Level: {fitness_level}
133
- - Available Equipment: {equipment_list}
134
-
135
- Instructions:
136
- 1. Divide the plan clearly into Day 1, Day 2, Day 3, Day 4, and Day 5.
137
- 2. Under each day, list 4-6 exercises.
138
- 3. For each exercise include:
139
- - Exercise Name
140
- - Sets
141
- - Reps
142
- - Rest Time
143
- 4. Keep exercises appropriate for the user’s fitness level.
144
- 5. Avoid medical or dietary advice.
145
- 6. Keep the output clean, structured, and easy to read.
146
- 7. Do NOT include explanations outside the workout plan.
147
-
148
- Only return the workout plan.
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  """
150
-
151
- with st.spinner("Generating your AI workout plan..."):
152
-
153
- inputs = tokenizer(prompt, return_tensors="pt", truncation=True)
154
-
155
- outputs = model.generate(
156
- **inputs,
157
- max_new_tokens=600,
158
- temperature=0.7,
159
- do_sample=True
160
- )
161
-
162
- result = tokenizer.decode(outputs[0], skip_special_tokens=True).strip()
163
-
164
- st.subheader("Your Personalized Workout Plan")
165
- st.write(result)
 
121
  equipment_list = ", ".join(equipment)
122
 
123
  prompt = f"""
124
+ prompt = f"""
125
+ You are a certified fitness trainer.
126
 
127
+ Create a STRICTLY formatted 5-day workout plan.
128
 
129
+ User Details:
130
  - Gender: {gender}
131
  - BMI: {bmi:.2f} ({bmi_status})
132
+ - Fitness Goal: {fitness_goal}
133
  - Fitness Level: {fitness_level}
134
+ - Equipment Available: {equipment_list}
135
+
136
+ IMPORTANT RULES:
137
+ 1. Output ONLY the workout plan.
138
+ 2. Divide into Day 1, Day 2, Day 3, Day 4, Day 5.
139
+ 3. Each day must contain EXACTLY 5 exercises.
140
+ 4. For each exercise include:
141
+ Exercise:
142
+ Sets:
143
+ Reps:
144
+ Rest:
145
+ 5. Keep exercises suitable for the fitness level.
146
+ 6. Do NOT add explanations, tips, introductions, or conclusions.
147
+ 7. Keep formatting clean and consistent.
148
+
149
+ OUTPUT FORMAT (FOLLOW EXACTLY):
150
+
151
+ Day 1: [Workout Focus]
152
+ 1. Exercise: Push-Ups
153
+ Sets: 3
154
+ Reps: 12
155
+ Rest: 60 sec
156
+
157
+ 2. Exercise: Squats
158
+ Sets: 3
159
+ Reps: 15
160
+ Rest: 60 sec
161
+
162
+ Continue same format for all 5 days.
163
  """