Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,15 +87,16 @@ iframe2 = '''
|
|
| 87 |
<iframe style="border-radius:12px" src="https://open.spotify.com/embed/playlist/6wwxTePuIKYMqt6RCytB7X?utm_source=generator" width="100%" height="300" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>
|
| 88 |
'''
|
| 89 |
|
|
|
|
| 90 |
# Define the welcome message and specific topics the chatbot can provide information about
|
| 91 |
-
# (Your welcome message and topics go here)
|
| 92 |
welcome_message = """
|
| 93 |
<span style="color:#718355; font-size:24px; font-weight:bold;"> 🪷 Welcome to CalmConnect! 🪷</span>
|
| 94 |
"""
|
| 95 |
|
| 96 |
-
|
|
|
|
|
|
|
| 97 |
|
| 98 |
-
# Define the topics for the chatbot
|
| 99 |
topics = """
|
| 100 |
### If you are interested in the following below, click on our Student Opportunities Database!
|
| 101 |
- Engineering
|
|
@@ -105,7 +106,7 @@ topics = """
|
|
| 105 |
- Law / Political Science / Debate
|
| 106 |
- The Arts
|
| 107 |
- Business / Leadership
|
| 108 |
-
-
|
| 109 |
- Medicine / Biology
|
| 110 |
- Literature / Writing
|
| 111 |
- College Prep
|
|
@@ -114,7 +115,7 @@ topics = """
|
|
| 114 |
- Study Abroad
|
| 115 |
"""
|
| 116 |
|
| 117 |
-
topics2
|
| 118 |
### Feel Free to ask CalmBot (Our Therapist Bot) anything from the topics below!
|
| 119 |
- Arts and Crafts (When asking for arts and crafts ideas, state whether you have 15 min, 30 min, 45 min, 1 hour, 1 hour and a half, 2 hours, 2 hours and a half, 3 hours or greater)
|
| 120 |
- Destressing strategies (Breathing Exercises, stretches, etc.)
|
|
@@ -127,32 +128,63 @@ topics2 = """
|
|
| 127 |
- Support Resources
|
| 128 |
"""
|
| 129 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
# Setup the Gradio Blocks interface with custom layout components
|
| 131 |
-
with gr.Blocks() as demo:
|
| 132 |
gr.Image("CalmConnect.jpg", show_label=False, show_share_button=False, show_download_button=False)
|
| 133 |
-
gr.Markdown(welcome_message)
|
| 134 |
-
|
| 135 |
with gr.Row():
|
| 136 |
with gr.Column():
|
| 137 |
-
gr.Markdown(topics)
|
| 138 |
-
gr.HTML(iframe)
|
| 139 |
-
gr.HTML(iframe2)
|
| 140 |
|
| 141 |
with gr.Column():
|
| 142 |
-
gr.Markdown(topics2)
|
| 143 |
with gr.Row():
|
| 144 |
with gr.Column():
|
| 145 |
question = gr.Textbox(label="You", placeholder="What do you want to talk to CalmBot about?")
|
| 146 |
answer = gr.Textbox(label="CalmBot's Response :D", placeholder="CalmBot will respond here..", interactive=False, lines=20)
|
| 147 |
submit_button = gr.Button("Submit")
|
| 148 |
submit_button.click(fn=query_model, inputs=question, outputs=answer)
|
| 149 |
-
|
| 150 |
with gr.Row():
|
| 151 |
-
# (Your buttons go here)
|
| 152 |
big_block = gr.HTML("### <button><a href='https://www.headspace.com/teens'>FREE: HEADSPACE FOR TEENS </a></button>")
|
| 153 |
big_block2 = gr.HTML("<button><a href='https://calmconnect-flower.replit.app/'>PLAY FLOWER GAME</a></button>")
|
| 154 |
big_block3 = gr.HTML("<button><a href='https://www.nyc.gov/site/doh/health/health-topics/teenspace.page'>NYC: TEENSPACE (free services)</a></button>")
|
| 155 |
-
big_block4 =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
|
| 157 |
# Launch the Gradio app to allow user interaction
|
| 158 |
demo.launch(share=True)
|
|
|
|
| 87 |
<iframe style="border-radius:12px" src="https://open.spotify.com/embed/playlist/6wwxTePuIKYMqt6RCytB7X?utm_source=generator" width="100%" height="300" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>
|
| 88 |
'''
|
| 89 |
|
| 90 |
+
|
| 91 |
# Define the welcome message and specific topics the chatbot can provide information about
|
|
|
|
| 92 |
welcome_message = """
|
| 93 |
<span style="color:#718355; font-size:24px; font-weight:bold;"> 🪷 Welcome to CalmConnect! 🪷</span>
|
| 94 |
"""
|
| 95 |
|
| 96 |
+
"""
|
| 97 |
+
## Your AI-driven assistant for destressing and extracurricular opportunity queries. Created by Olivia W, Alice T, and Cindy W of the 2024 Kode With Klossy CITY Camp.
|
| 98 |
+
"""
|
| 99 |
|
|
|
|
| 100 |
topics = """
|
| 101 |
### If you are interested in the following below, click on our Student Opportunities Database!
|
| 102 |
- Engineering
|
|
|
|
| 106 |
- Law / Political Science / Debate
|
| 107 |
- The Arts
|
| 108 |
- Business / Leadership
|
| 109 |
+
- Pyschology
|
| 110 |
- Medicine / Biology
|
| 111 |
- Literature / Writing
|
| 112 |
- College Prep
|
|
|
|
| 115 |
- Study Abroad
|
| 116 |
"""
|
| 117 |
|
| 118 |
+
topics2= """
|
| 119 |
### Feel Free to ask CalmBot (Our Therapist Bot) anything from the topics below!
|
| 120 |
- Arts and Crafts (When asking for arts and crafts ideas, state whether you have 15 min, 30 min, 45 min, 1 hour, 1 hour and a half, 2 hours, 2 hours and a half, 3 hours or greater)
|
| 121 |
- Destressing strategies (Breathing Exercises, stretches, etc.)
|
|
|
|
| 128 |
- Support Resources
|
| 129 |
"""
|
| 130 |
|
| 131 |
+
# Create a Gradio HTML component
|
| 132 |
+
def display_iframe():
|
| 133 |
+
return iframe
|
| 134 |
+
|
| 135 |
+
def display_iframe2():
|
| 136 |
+
return iframe2
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
theme = gr.themes.Default(
|
| 140 |
+
primary_hue="neutral",
|
| 141 |
+
secondary_hue="neutral",
|
| 142 |
+
).set(
|
| 143 |
+
background_fill_primary='#e3e9da',
|
| 144 |
+
background_fill_primary_dark='#e3e9da',
|
| 145 |
+
background_fill_secondary="#f8f1ea",
|
| 146 |
+
background_fill_secondary_dark="#f8f1ea",
|
| 147 |
+
border_color_accent="#f8f1ea",
|
| 148 |
+
border_color_accent_dark="#e3e9da",
|
| 149 |
+
border_color_accent_subdued="#f8f1ea",
|
| 150 |
+
border_color_primary="#f8f1ea",
|
| 151 |
+
block_border_color="#f8f1ea",
|
| 152 |
+
button_primary_background_fill="#f8f1ea",
|
| 153 |
+
button_primary_background_fill_dark="#f8f1ea"
|
| 154 |
+
)
|
| 155 |
+
|
| 156 |
# Setup the Gradio Blocks interface with custom layout components
|
| 157 |
+
with gr.Blocks(theme=theme) as demo:
|
| 158 |
gr.Image("CalmConnect.jpg", show_label=False, show_share_button=False, show_download_button=False)
|
| 159 |
+
gr.Markdown(welcome_message) # Display the formatted welcome message
|
| 160 |
+
|
| 161 |
with gr.Row():
|
| 162 |
with gr.Column():
|
| 163 |
+
gr.Markdown(topics) # Show the topics on the left side
|
| 164 |
+
gr.HTML(iframe) # Embed the iframe on the left side
|
| 165 |
+
gr.HTML(iframe2) # Embed the iframe on the right side
|
| 166 |
|
| 167 |
with gr.Column():
|
| 168 |
+
gr.Markdown(topics2) # Show the topics on the left side
|
| 169 |
with gr.Row():
|
| 170 |
with gr.Column():
|
| 171 |
question = gr.Textbox(label="You", placeholder="What do you want to talk to CalmBot about?")
|
| 172 |
answer = gr.Textbox(label="CalmBot's Response :D", placeholder="CalmBot will respond here..", interactive=False, lines=20)
|
| 173 |
submit_button = gr.Button("Submit")
|
| 174 |
submit_button.click(fn=query_model, inputs=question, outputs=answer)
|
| 175 |
+
|
| 176 |
with gr.Row():
|
|
|
|
| 177 |
big_block = gr.HTML("### <button><a href='https://www.headspace.com/teens'>FREE: HEADSPACE FOR TEENS </a></button>")
|
| 178 |
big_block2 = gr.HTML("<button><a href='https://calmconnect-flower.replit.app/'>PLAY FLOWER GAME</a></button>")
|
| 179 |
big_block3 = gr.HTML("<button><a href='https://www.nyc.gov/site/doh/health/health-topics/teenspace.page'>NYC: TEENSPACE (free services)</a></button>")
|
| 180 |
+
big_block4 =gr.HTML("<button><a href='https://www.teenlife.com/blog/mental-health-resources-for-teens/'>TEEN MENTAL HEALTH RESOURCES (free services)</a></button>")
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
demo.launch()
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
|
| 188 |
|
| 189 |
# Launch the Gradio app to allow user interaction
|
| 190 |
demo.launch(share=True)
|