Spaces:
Runtime error
Runtime error
trying to add color (hopefully it works or else going to previous code!)
Browse files
app.py
CHANGED
|
@@ -73,8 +73,34 @@ def respond(message, history):
|
|
| 73 |
token = messages.choices[0].delta.content
|
| 74 |
response+= token
|
| 75 |
yield response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
chatbot = gr.ChatInterface(respond, type = 'messages', title= "Hi! I'm Nessie, your personal wellness assistant. What can I assist you with today?",examples=["Can I help you with your dietary goals? I can help you track your calories, macros, and give advice based on personal goals, height, and weight.","Can I help you with your physical health and help you reach your fitness goals? I can give guidance and recommendations for specific workouts based on personal goals.","If you are struggling, I am here. You are so beautiful and so loved! I'm here for whatever you need. "])
|
| 78 |
chatbot.launch(debug=True)
|
| 79 |
|
| 80 |
|
|
|
|
| 73 |
token = messages.choices[0].delta.content
|
| 74 |
response+= token
|
| 75 |
yield response
|
| 76 |
+
|
| 77 |
+
custom_css = """
|
| 78 |
+
.gradio-container {
|
| 79 |
+
background-color: #fff5f8;
|
| 80 |
+
}
|
| 81 |
+
.message.bot {
|
| 82 |
+
background-color: #dbeafe; /* soft blue */
|
| 83 |
+
color: #1e3a8a; /* navy */
|
| 84 |
+
}
|
| 85 |
+
.message.user {
|
| 86 |
+
background-color: #fce7f3; /* soft pink */
|
| 87 |
+
color: #831843; /* deep rose */
|
| 88 |
+
}
|
| 89 |
+
"""
|
| 90 |
+
|
| 91 |
+
with gr.Blocks(css=custom_css) as demo:
|
| 92 |
+
chatbot = gr.ChatInterface(
|
| 93 |
+
fn=respond,
|
| 94 |
+
type='messages',
|
| 95 |
+
title="Hi! I'm Nessie, your personal wellness assistant. What can I assist you with today?",
|
| 96 |
+
examples=[
|
| 97 |
+
"Can I help you with your dietary goals? I can help you track your calories, macros, and give advice based on personal goals, height, and weight.",
|
| 98 |
+
"Can I help you with your physical health and help you reach your fitness goals? I can give guidance and recommendations for specific workouts based on personal goals.",
|
| 99 |
+
"If you are struggling, I am here. You are so beautiful and so loved! I'm here for whatever you need."
|
| 100 |
+
]
|
| 101 |
+
)
|
| 102 |
|
| 103 |
+
#chatbot = gr.ChatInterface(respond, type = 'messages', title= "Hi! I'm Nessie, your personal wellness assistant. What can I assist you with today?",examples=["Can I help you with your dietary goals? I can help you track your calories, macros, and give advice based on personal goals, height, and weight.","Can I help you with your physical health and help you reach your fitness goals? I can give guidance and recommendations for specific workouts based on personal goals.","If you are struggling, I am here. You are so beautiful and so loved! I'm here for whatever you need. "])
|
| 104 |
chatbot.launch(debug=True)
|
| 105 |
|
| 106 |
|