Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
affirmations = {
|
| 4 |
+
"confidence": [
|
| 5 |
+
"You are enough just as you are.",
|
| 6 |
+
"Your voice matters.",
|
| 7 |
+
"You are capable of amazing things.",
|
| 8 |
+
"You are creative and full of ideas.",
|
| 9 |
+
"You’re doing better than you think.",
|
| 10 |
+
"You are worthy of good things.",
|
| 11 |
+
"Believe in your own magic.",
|
| 12 |
+
"You have the power to change your story.",
|
| 13 |
+
"You are brave and resilient.",
|
| 14 |
+
"You are proud of yourself.",
|
| 15 |
+
"You have a unique purpose.",
|
| 16 |
+
"You are a positive force in the world.",
|
| 17 |
+
"You are deserving of happiness.",
|
| 18 |
+
"You can overcome challenges with grace.",
|
| 19 |
+
"You are in charge of your own happiness.",
|
| 20 |
+
"You inspire others without even trying.",
|
| 21 |
+
"Your dreams are worth chasing.",
|
| 22 |
+
"You are becoming the best version of yourself."
|
| 23 |
+
],
|
| 24 |
+
"calm": [
|
| 25 |
+
"It’s okay to take a break.",
|
| 26 |
+
"Your feelings are valid.",
|
| 27 |
+
"You deserve kindness and respect.",
|
| 28 |
+
"Mistakes are part of learning.",
|
| 29 |
+
"You are surrounded by love.",
|
| 30 |
+
"You bring light to those around you.",
|
| 31 |
+
"You are patient with yourself.",
|
| 32 |
+
"You are kind to yourself and others."
|
| 33 |
+
],
|
| 34 |
+
"focus": [
|
| 35 |
+
"Keep growing, one step at a time.",
|
| 36 |
+
"Every day is a new opportunity.",
|
| 37 |
+
"You are making progress even if it’s small."
|
| 38 |
+
]
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
def get_affirmations(category):
|
| 42 |
+
return "\n".join(affirmations.get(category, []))
|
| 43 |
+
|
| 44 |
+
demo = gr.Interface(
|
| 45 |
+
fn=get_affirmations,
|
| 46 |
+
inputs=gr.Dropdown(choices=list(affirmations.keys()), label="Select Category"),
|
| 47 |
+
outputs="text",
|
| 48 |
+
title="Affirmation API",
|
| 49 |
+
description="Select a category to view affirmations. Powered by Kingston!"
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
demo.launch()
|