Spaces:
Sleeping
Sleeping
Fazeel Asghar
commited on
Commit
·
9a5fa88
1
Parent(s):
44c3464
Changes in the interface 3
Browse files
app.py
CHANGED
|
@@ -59,43 +59,46 @@ def clear_session(session_id):
|
|
| 59 |
|
| 60 |
with gr.Blocks(css="""
|
| 61 |
.chatbot .message.user {
|
| 62 |
-
background-color: #
|
| 63 |
color: white;
|
| 64 |
-
|
| 65 |
-
|
| 66 |
max-width: 75%;
|
| 67 |
-
margin:
|
| 68 |
align-self: flex-end;
|
|
|
|
| 69 |
}
|
| 70 |
.chatbot .message.bot {
|
| 71 |
-
background-color: #
|
| 72 |
-
color:
|
| 73 |
-
|
| 74 |
-
|
| 75 |
max-width: 75%;
|
| 76 |
-
margin:
|
| 77 |
align-self: flex-start;
|
|
|
|
| 78 |
}
|
| 79 |
.chatbot {
|
| 80 |
-
font-family:
|
| 81 |
font-size: 16px;
|
| 82 |
display: flex;
|
| 83 |
flex-direction: column;
|
| 84 |
}
|
| 85 |
""") as demo:
|
| 86 |
-
|
|
|
|
| 87 |
|
| 88 |
state = gr.State([])
|
| 89 |
|
| 90 |
with gr.Row():
|
| 91 |
-
user_input = gr.Textbox(label="
|
| 92 |
-
send_btn = gr.Button("
|
| 93 |
|
| 94 |
-
chatbot = gr.Chatbot(label="
|
| 95 |
|
| 96 |
with gr.Row():
|
| 97 |
session_id = gr.Textbox(label="Session ID", value="gradio_default", interactive=True)
|
| 98 |
-
clear_btn = gr.Button("
|
| 99 |
|
| 100 |
send_btn.click(
|
| 101 |
fn=chat_interface,
|
|
|
|
| 59 |
|
| 60 |
with gr.Blocks(css="""
|
| 61 |
.chatbot .message.user {
|
| 62 |
+
background-color: #007bff;
|
| 63 |
color: white;
|
| 64 |
+
padding: 12px;
|
| 65 |
+
border-radius: 12px;
|
| 66 |
max-width: 75%;
|
| 67 |
+
margin: 6px 0;
|
| 68 |
align-self: flex-end;
|
| 69 |
+
font-size: 15px;
|
| 70 |
}
|
| 71 |
.chatbot .message.bot {
|
| 72 |
+
background-color: #e9ecef;
|
| 73 |
+
color: #212529;
|
| 74 |
+
padding: 12px;
|
| 75 |
+
border-radius: 12px;
|
| 76 |
max-width: 75%;
|
| 77 |
+
margin: 6px 0;
|
| 78 |
align-self: flex-start;
|
| 79 |
+
font-size: 15px;
|
| 80 |
}
|
| 81 |
.chatbot {
|
| 82 |
+
font-family: 'Segoe UI', sans-serif;
|
| 83 |
font-size: 16px;
|
| 84 |
display: flex;
|
| 85 |
flex-direction: column;
|
| 86 |
}
|
| 87 |
""") as demo:
|
| 88 |
+
|
| 89 |
+
gr.Markdown("### 🤖 AI Chat Assistant (Powered by Groq LLaMA3)")
|
| 90 |
|
| 91 |
state = gr.State([])
|
| 92 |
|
| 93 |
with gr.Row():
|
| 94 |
+
user_input = gr.Textbox(label="Enter your message", placeholder="Ask anything...", lines=1)
|
| 95 |
+
send_btn = gr.Button("Send")
|
| 96 |
|
| 97 |
+
chatbot = gr.Chatbot(label="", elem_classes="chatbot")
|
| 98 |
|
| 99 |
with gr.Row():
|
| 100 |
session_id = gr.Textbox(label="Session ID", value="gradio_default", interactive=True)
|
| 101 |
+
clear_btn = gr.Button("Clear Chat")
|
| 102 |
|
| 103 |
send_btn.click(
|
| 104 |
fn=chat_interface,
|