Meet your cheerful chat buddy! This app is your optimistic friend who always sees the bright side. From everyday questions to life’s big moments, get uplifting responses and positive vibes that’ll make you smile, no matter what you’re asking about!

Update app.py
All checks were successful
society-ai-hub-container-cache Actions Demo / build (push) Successful in 26s

This commit is contained in:
LiorDav 2024-11-06 18:13:08 +00:00
parent b47383c2ba
commit d985f12c7c

11
app.py

@ -14,15 +14,18 @@ SYSTEM_PROMPT = {
}
# Background CSS to include a background image
BACKGROUND_CSS = """
BACKGROUND_CSS =
body {
background-image: url('https://example.com/path/to/your/background-image.jpg');
background-image: url('https://ibb.co/wYc6RYb');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
}
footer {
visibility: hidden;
}
"""
# Custom Gradio app with additional features
with gr.Blocks(css=BACKGROUND_CSS) as demo:
@ -32,7 +35,6 @@ with gr.Blocks(css=BACKGROUND_CSS) as demo:
chatbot = gr.Chatbot(type="messages")
msg = gr.Textbox(placeholder="Type your message here...")
clear = gr.Button("Clear")
save_chat = gr.Button("Save Chat History")
def user(user_message, user_name, mood, history: list):
"""Appends the user message to the conversation history, prefixed with the user name and mood."""
@ -74,7 +76,6 @@ with gr.Blocks(css=BACKGROUND_CSS) as demo:
bot, chatbot, chatbot
)
clear.click(lambda: None, None, chatbot, queue=False)
save_chat.click(lambda history: gr.File.update(value=save_history(history)), chatbot)
if __name__ == "__main__":
demo.launch()