Spaces:
Sleeping
Sleeping
Update app.py
Browse filesUpdated Prompt Generation:
Modified the system prompt to include specific details about the exercise and the desired feedback.
Ensured the prompt asks for coaching cues in Arnold’s motivational style.
Added Fallback Responses:
Added a fallback response for non-exercise images in Arnold’s voice, encouraging the user to upload a proper exercise picture.
app.py
CHANGED
@@ -17,6 +17,7 @@ model = AutoModelForCausalLM.from_pretrained(model_id, device_map="cuda", trust_
|
|
17 |
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
|
18 |
model.to("cuda:0")
|
19 |
|
|
|
20 |
PLACEHOLDER = """
|
21 |
<div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; background-image: url('https://huggingface.co/spaces/simonraj/PersonalTrainer-Arnold/blob/main/fitness_coach_app_resized.jpg'); background-size: cover; background-position: center; width: 100%; height: 100vh;">
|
22 |
<div style="background-color: rgba(255, 255, 255, 0.8); padding: 20px; border-radius: 10px; width: 80%; max-width: 550px; text-align: center;">
|
@@ -31,10 +32,6 @@ PLACEHOLDER = """
|
|
31 |
</div>
|
32 |
"""
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
@spaces.GPU
|
39 |
def bot_streaming(message, history):
|
40 |
print(f'message is - {message}')
|
|
|
17 |
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
|
18 |
model.to("cuda:0")
|
19 |
|
20 |
+
# Enhanced Placeholder HTML with instructions and centralization
|
21 |
PLACEHOLDER = """
|
22 |
<div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; background-image: url('https://huggingface.co/spaces/simonraj/PersonalTrainer-Arnold/blob/main/fitness_coach_app_resized.jpg'); background-size: cover; background-position: center; width: 100%; height: 100vh;">
|
23 |
<div style="background-color: rgba(255, 255, 255, 0.8); padding: 20px; border-radius: 10px; width: 80%; max-width: 550px; text-align: center;">
|
|
|
32 |
</div>
|
33 |
"""
|
34 |
|
|
|
|
|
|
|
|
|
35 |
@spaces.GPU
|
36 |
def bot_streaming(message, history):
|
37 |
print(f'message is - {message}')
|