Spaces:
Running
Running
mrmarvelous
commited on
Commit
•
19648e8
1
Parent(s):
ece7998
Update app.py
Browse files
app.py
CHANGED
@@ -41,9 +41,7 @@ model = genai.GenerativeModel(model_name = "gemini-pro-vision",
|
|
41 |
input_prompt = """ You are a highly renowned health and nutrition expert FitnessGPT. Take the following information about me and create a custom diet and exercise plan. I am #Age years old, #gender gender, #height inches tall. My current weight is #currentweight weight in pounds. My current medical conditions are #medicalconditions. I have food allergies to #foodallergies. My primary fitness and health goals are #fitnessgoals and #fitnessgoals. I can commit to working out #daysperweek days per week. I prefer and enjoy this type of workout - #typeofworkout and #typeofworkout. I have a diet preference of #dietpreference. I want to have #numbersofmeals Meals and #numbersofmeals Snacks per day. I dislike and cannot eat #foodyoudislike. Create a summary of my diet and exercise plan. Create a detailed workout program for my exercise plan. Create a detailed Meal Plan for my diet. Create a detailed Grocery List for my diet that includes the quantity of each item. Avoid any superfluous pre and post-descriptive text. Don't break character under any circumstance. """
|
42 |
|
43 |
|
44 |
-
|
45 |
-
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
46 |
-
"""
|
47 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
48 |
|
49 |
|
@@ -65,30 +63,8 @@ def respond(
|
|
65 |
|
66 |
messages.append({"role": "user", "content": message})
|
67 |
|
68 |
-
response =
|
69 |
-
"""
|
70 |
-
"*Summary of Diet and Exercise Plan:*
|
71 |
-
|
72 |
-
*Diet:*
|
73 |
-
- Meals: 3 per day
|
74 |
-
- Snacks: 3 per day
|
75 |
-
- Type: Vegetarian
|
76 |
-
|
77 |
-
*Exercise:*
|
78 |
-
- Frequency: 5 days per week
|
79 |
-
- Type: High-Intensity and Muscle Training Workouts
|
80 |
-
|
81 |
-
---
|
82 |
-
|
83 |
-
*Detailed Workout Program:*
|
84 |
-
|
85 |
-
*Day 1: Upper Body Strength*
|
86 |
|
87 |
-
1. Warm-up: 10 minutes of dynamic stretching and light cardio
|
88 |
-
2. Push-ups: 3 sets of 12 reps
|
89 |
-
3. Dumbbell Bench Press: 4 sets of 10 reps
|
90 |
-
4. Bent-over Rows: 4"
|
91 |
-
"""
|
92 |
for message in client.chat_completion(
|
93 |
messages,
|
94 |
max_tokens=max_tokens,
|
|
|
41 |
input_prompt = """ You are a highly renowned health and nutrition expert FitnessGPT. Take the following information about me and create a custom diet and exercise plan. I am #Age years old, #gender gender, #height inches tall. My current weight is #currentweight weight in pounds. My current medical conditions are #medicalconditions. I have food allergies to #foodallergies. My primary fitness and health goals are #fitnessgoals and #fitnessgoals. I can commit to working out #daysperweek days per week. I prefer and enjoy this type of workout - #typeofworkout and #typeofworkout. I have a diet preference of #dietpreference. I want to have #numbersofmeals Meals and #numbersofmeals Snacks per day. I dislike and cannot eat #foodyoudislike. Create a summary of my diet and exercise plan. Create a detailed workout program for my exercise plan. Create a detailed Meal Plan for my diet. Create a detailed Grocery List for my diet that includes the quantity of each item. Avoid any superfluous pre and post-descriptive text. Don't break character under any circumstance. """
|
42 |
|
43 |
|
44 |
+
|
|
|
|
|
45 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
46 |
|
47 |
|
|
|
63 |
|
64 |
messages.append({"role": "user", "content": message})
|
65 |
|
66 |
+
response = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
|
|
|
|
|
|
|
|
|
|
68 |
for message in client.chat_completion(
|
69 |
messages,
|
70 |
max_tokens=max_tokens,
|