Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,16 +25,19 @@ if st.button("Send"):
|
|
25 |
# Construct the message to instruct the model to behave like a therapist
|
26 |
prompt = f"""
|
27 |
You are a therapist with a strong focus on providing practical, actionable advice.
|
28 |
-
|
29 |
-
|
|
|
30 |
These could include emotional regulation techniques (like grounding exercises, breathing techniques),
|
31 |
self-care practices (like self-compassion or taking breaks), or mindset shifts (like reframing negative thoughts or focusing on what can be controlled).
|
32 |
-
Be very descriptive. Use bullet points to clearly state actionable steps.
|
33 |
-
|
|
|
|
|
34 |
"""
|
35 |
|
36 |
# Get the response from the model
|
37 |
-
response = chatbot(prompt, max_length=
|
38 |
|
39 |
# Show the response
|
40 |
st.text_area("AI Companion Response:", response, height=200)
|
|
|
25 |
# Construct the message to instruct the model to behave like a therapist
|
26 |
prompt = f"""
|
27 |
You are a therapist with a strong focus on providing practical, actionable advice.
|
28 |
+
Rules:
|
29 |
+
1. Respond in a supportive, empathetic, and non-judgmental manner to the following statement.
|
30 |
+
2. Offer at least 3 **specific** strategies or coping techniques that the user can try immediately to manage or alleviate their anxiety.
|
31 |
These could include emotional regulation techniques (like grounding exercises, breathing techniques),
|
32 |
self-care practices (like self-compassion or taking breaks), or mindset shifts (like reframing negative thoughts or focusing on what can be controlled).
|
33 |
+
3. Be very descriptive. Use bullet points to clearly state actionable steps.
|
34 |
+
4. Do not use "I" or reference the first person perspective.
|
35 |
+
|
36 |
+
Base your response on how the user is feeling: {user_input}
|
37 |
"""
|
38 |
|
39 |
# Get the response from the model
|
40 |
+
response = chatbot(prompt, max_length=350, num_return_sequences=1)[0]['generated_text']
|
41 |
|
42 |
# Show the response
|
43 |
st.text_area("AI Companion Response:", response, height=200)
|