Fazeel Asghar commited on
Commit
9a5fa88
·
1 Parent(s): 44c3464

Changes in the interface 3

Browse files
Files changed (1) hide show
  1. app.py +18 -15
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: #25D366;
63
  color: white;
64
- border-radius: 18px;
65
- padding: 10px;
66
  max-width: 75%;
67
- margin: 5px 0;
68
  align-self: flex-end;
 
69
  }
70
  .chatbot .message.bot {
71
- background-color: #f1f0f0;
72
- color: black;
73
- border-radius: 18px;
74
- padding: 10px;
75
  max-width: 75%;
76
- margin: 5px 0;
77
  align-self: flex-start;
 
78
  }
79
  .chatbot {
80
- font-family: "Segoe UI", sans-serif;
81
  font-size: 16px;
82
  display: flex;
83
  flex-direction: column;
84
  }
85
  """) as demo:
86
- gr.Markdown("## 💬 WhatsApp-style AI Chat (Powered by Groq LLaMA3)")
 
87
 
88
  state = gr.State([])
89
 
90
  with gr.Row():
91
- user_input = gr.Textbox(label="Type your message...", placeholder="Write a message...", lines=1)
92
- send_btn = gr.Button("📤 Send", variant="primary")
93
 
94
- chatbot = gr.Chatbot(label="Chat", elem_classes="chatbot")
95
 
96
  with gr.Row():
97
  session_id = gr.Textbox(label="Session ID", value="gradio_default", interactive=True)
98
- clear_btn = gr.Button("🔄 Clear Session")
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,