Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -173,61 +173,85 @@ body {
|
|
173 |
background: linear-gradient(135deg, #0d0d0d, #ff5722);
|
174 |
color: white;
|
175 |
}
|
|
|
176 |
h1 {
|
177 |
-
|
178 |
-
color:
|
179 |
-
|
|
|
180 |
font-weight: bold;
|
|
|
|
|
181 |
}
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
padding: 10px;
|
|
|
|
|
|
|
|
|
191 |
}
|
192 |
-
|
193 |
-
|
|
|
|
|
194 |
color: white;
|
195 |
-
font-size:
|
196 |
-
|
197 |
-
border-radius: 5px;
|
198 |
-
border: none;
|
199 |
-
cursor: pointer;
|
200 |
-
}
|
201 |
-
button:hover {
|
202 |
-
background-color: #e64a19;
|
203 |
}
|
204 |
"""
|
205 |
|
206 |
-
# Gradio
|
207 |
with gr.Blocks(css=custom_css) as app:
|
208 |
-
gr.
|
209 |
with gr.Row():
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
gr.
|
214 |
-
|
215 |
-
|
216 |
-
suggestions_output = gr.DataFrame(headers=["Title", "Link"], label="Suggestions")
|
217 |
|
218 |
-
|
219 |
-
|
220 |
-
query_input = gr.Textbox(label="Query (e.g., therapist, clinic)", placeholder="Type something...", interactive=True)
|
221 |
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
|
|
227 |
app_function,
|
228 |
-
inputs=[user_input,
|
229 |
-
outputs=[
|
230 |
)
|
231 |
|
232 |
-
|
233 |
-
app.launch(share=True)
|
|
|
173 |
background: linear-gradient(135deg, #0d0d0d, #ff5722);
|
174 |
color: white;
|
175 |
}
|
176 |
+
|
177 |
h1 {
|
178 |
+
background: #ffffff;
|
179 |
+
color: #000000;
|
180 |
+
border-radius: 8px;
|
181 |
+
padding: 10px;
|
182 |
font-weight: bold;
|
183 |
+
text-align: center;
|
184 |
+
font-size: 2.5rem;
|
185 |
}
|
186 |
+
|
187 |
+
textarea, input {
|
188 |
+
background: transparent;
|
189 |
+
color: black;
|
190 |
+
border: 2px solid orange;
|
191 |
+
padding: 8px;
|
192 |
+
font-size: 1rem;
|
193 |
+
caret-color: black;
|
194 |
+
outline: none;
|
195 |
+
border-radius: 8px;
|
196 |
+
}
|
197 |
+
|
198 |
+
textarea:focus, input:focus {
|
199 |
+
background: transparent;
|
200 |
+
color: black;
|
201 |
+
border: 2px solid orange;
|
202 |
+
outline: none;
|
203 |
+
}
|
204 |
+
|
205 |
+
textarea:hover, input:hover {
|
206 |
+
background: transparent;
|
207 |
+
color: black;
|
208 |
+
border: 2px solid orange;
|
209 |
+
}
|
210 |
+
|
211 |
+
.df-container {
|
212 |
+
background: white;
|
213 |
+
color: black;
|
214 |
+
border: 2px solid orange;
|
215 |
+
border-radius: 10px;
|
216 |
padding: 10px;
|
217 |
+
font-size: 14px;
|
218 |
+
max-height: 400px;
|
219 |
+
height: auto;
|
220 |
+
overflow-y: auto;
|
221 |
}
|
222 |
+
|
223 |
+
#suggestions-title {
|
224 |
+
text-align: center;
|
225 |
+
font-weight: bold;
|
226 |
color: white;
|
227 |
+
font-size: 1.8rem;
|
228 |
+
margin-bottom: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
}
|
230 |
"""
|
231 |
|
232 |
+
# Gradio Application
|
233 |
with gr.Blocks(css=custom_css) as app:
|
234 |
+
gr.HTML("<h1>🌟 Well-Being Companion</h1>")
|
235 |
with gr.Row():
|
236 |
+
user_input = gr.Textbox(label="Your Message")
|
237 |
+
location = gr.Textbox(label="Your Location")
|
238 |
+
query = gr.Textbox(label="Search Query")
|
239 |
+
chatbot = gr.Chatbot(label="Chat History")
|
240 |
+
sentiment = gr.Textbox(label="Detected Sentiment")
|
241 |
+
emotion = gr.Textbox(label="Detected Emotion")
|
|
|
242 |
|
243 |
+
# Adding Suggestions Title with Styled Markdown (Centered and Bold)
|
244 |
+
gr.Markdown("Suggestions", elem_id="suggestions-title")
|
|
|
245 |
|
246 |
+
suggestions = gr.DataFrame(headers=["Title", "Link"]) # Table for suggestions
|
247 |
+
professionals = gr.Textbox(label="Nearby Professionals", lines=6)
|
248 |
+
map_html = gr.HTML(label="Interactive Map")
|
249 |
+
submit = gr.Button(value="Submit", variant="primary")
|
250 |
+
|
251 |
+
submit.click(
|
252 |
app_function,
|
253 |
+
inputs=[user_input, location, query, chatbot],
|
254 |
+
outputs=[chatbot, sentiment, emotion, suggestions, professionals, map_html],
|
255 |
)
|
256 |
|
257 |
+
app.launch()
|
|