ha7naa commited on
Commit
2cdf1bc
·
verified ·
1 Parent(s): cb01aad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -9
app.py CHANGED
@@ -4,11 +4,26 @@ import os
4
 
5
  client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
6
 
7
- SYSTEM_PROMPT = """You are an expert in storyboarding. Provide structured and insightful responses to queries
8
- about creating and refining storyboards"""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  def respond(message, history, model, temperature, max_tokens):
11
- messages = [{"role": "system", "content": SYSTEM_PROMPT}]
 
12
 
13
  for h in history:
14
  messages.append({"role": "user", "content": h[0]})
@@ -31,8 +46,8 @@ def respond(message, history, model, temperature, max_tokens):
31
  # ChatInterface with additional inputs for parameters
32
  demo = gr.ChatInterface(
33
  fn=respond,
34
- title="🎬 Storyboard Generator AI",
35
- description="Create professional storyboards for films, animations, and more!",
36
  additional_inputs=[
37
  gr.Dropdown(
38
  choices=[
@@ -61,10 +76,11 @@ demo = gr.ChatInterface(
61
  ),
62
  ],
63
  examples=[
64
- ["Create a storyboard for a 30-second coffee commercial"],
65
- ["Generate a horror movie opening scene storyboard"],
66
- ["Design a storyboard for a romantic comedy meet-cute at a bookstore"],
67
- ],
 
68
  theme="soft",
69
  )
70
 
 
4
 
5
  client = Groq(api_key=os.environ.get("GROQ_API_KEY"))
6
 
7
+ SYSTEM_PROMPT = """You are a professional exercise advisor and fitness coach.
8
+ Your goal is to help users improve their physical fitness safely.
9
+ Provide beginner-friendly workout advice, warm-up tips, and recovery guidance.
10
+ Avoid medical diagnosis and always encourage safe exercise habits."""
11
+
12
+ EXAMPLES = """
13
+ User: I am a beginner. How should I start exercising?
14
+ Assistant: Start with light exercises such as walking, stretching, and bodyweight movements. Aim for 15–20 minutes per session and increase gradually.
15
+
16
+ User: How many days per week should I work out?
17
+ Assistant: Beginners should exercise 3–4 days per week, allowing rest days for recovery.
18
+
19
+ User: What should I do before a workout?
20
+ Assistant: Always begin with a warm-up like light cardio and dynamic stretching to prevent injuries.
21
+ """
22
+
23
 
24
  def respond(message, history, model, temperature, max_tokens):
25
+ messages = [{"role": "system", "content": SYSTEM_PROMPT + EXAMPLES}]
26
+
27
 
28
  for h in history:
29
  messages.append({"role": "user", "content": h[0]})
 
46
  # ChatInterface with additional inputs for parameters
47
  demo = gr.ChatInterface(
48
  fn=respond,
49
+ title="🎬 Exercise Advisor AI",
50
+ description="Your personal assistant for safe and effective workouts",
51
  additional_inputs=[
52
  gr.Dropdown(
53
  choices=[
 
76
  ),
77
  ],
78
  examples=[
79
+ ["I am a beginner. How should I start exercising?"],
80
+ ["How many days per week should I work out?"],
81
+ ["What is the best warm-up before training?"],
82
+ ]
83
+
84
  theme="soft",
85
  )
86