rbbist commited on
Commit
6388e9c
·
verified ·
1 Parent(s): 947e3a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -157,6 +157,7 @@ css = """
157
  .gradio-container {
158
  max-width: 800px !important;
159
  margin: auto !important;
 
160
  }
161
  .message.user {
162
  background-color: #e3f2fd !important;
@@ -165,19 +166,29 @@ css = """
165
  color: #1e1e1e !important; /* Dark text for user messages */
166
  }
167
  .message.bot {
168
- background-color: #f5f5f5 !important;
169
  border-radius: 15px !important;
170
  padding: 10px !important;
171
  color: #1e1e1e !important; /* Dark text for bot messages */
172
  }
 
 
 
173
  .input-container {
174
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
175
  border-radius: 25px !important;
176
  }
 
 
 
 
 
 
 
177
  """
178
 
179
  # Create the Gradio interface
180
- with gr.Blocks(css=css, title="Simple Nepali Chatbot", theme=gr.themes.Soft()) as demo:
181
 
182
  gr.HTML("""
183
  <div style="text-align: center; padding: 20px;">
@@ -191,7 +202,7 @@ with gr.Blocks(css=css, title="Simple Nepali Chatbot", theme=gr.themes.Soft()) a
191
  """)
192
 
193
  chatbot_ui = gr.Chatbot(
194
- value=[["नमस्ते! Hello!", "नमस्ते! तपाईंलाई स्वागत छ! Hello and welcome! How can I help you today? तपाईंलाई कसरी मद्दत गर्न सक्छु?"]],
195
  height=400,
196
  show_label=False,
197
  container=True,
@@ -246,7 +257,7 @@ with gr.Blocks(css=css, title="Simple Nepali Chatbot", theme=gr.themes.Soft()) a
246
  )
247
 
248
  gr.HTML("""
249
- <div style="text-align: center; margin-top: 20px; padding: 20px; background: #f8f9fa; border-radius: 10px;">
250
  <h3>📝 About this Chatbot</h3>
251
  <p>This is a simple rule-based chatbot that responds in both Nepali and English.</p>
252
  <p><strong>यो एक सरल नियम-आधारित च्याटबोट हो जसले नेपाली र अंग्रेजी दुवैमा जवाफ दिन्छ।</strong></p>
 
157
  .gradio-container {
158
  max-width: 800px !important;
159
  margin: auto !important;
160
+ background-color: #1a1a2e !important; /* Dark background for contrast */
161
  }
162
  .message.user {
163
  background-color: #e3f2fd !important;
 
166
  color: #1e1e1e !important; /* Dark text for user messages */
167
  }
168
  .message.bot {
169
+ background-color: #d1d1d1 !important; /* Slightly darker gray for bot messages */
170
  border-radius: 15px !important;
171
  padding: 10px !important;
172
  color: #1e1e1e !important; /* Dark text for bot messages */
173
  }
174
+ .chatbot .message {
175
+ color: #1e1e1e !important; /* Ensure all messages use dark text */
176
+ }
177
  .input-container {
178
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
179
  border-radius: 25px !important;
180
  }
181
+ .input-container input {
182
+ color: #ffffff !important; /* White text for input field */
183
+ background: transparent !important;
184
+ }
185
+ .gradio-chatbot {
186
+ background-color: #16213e !important; /* Darker chat area background */
187
+ }
188
  """
189
 
190
  # Create the Gradio interface
191
+ with gr.Blocks(css=css, title="Simple Nepali Chatbot", theme=gr.themes.Default()) as demo:
192
 
193
  gr.HTML("""
194
  <div style="text-align: center; padding: 20px;">
 
202
  """)
203
 
204
  chatbot_ui = gr.Chatbot(
205
+ value=None, # Removed initial message to avoid pre-rendered style issues
206
  height=400,
207
  show_label=False,
208
  container=True,
 
257
  )
258
 
259
  gr.HTML("""
260
+ <div style="text-align: center; margin-top: 20px; padding: 20px; background: #16213e; border-radius: 10px; color: #ffffff;">
261
  <h3>📝 About this Chatbot</h3>
262
  <p>This is a simple rule-based chatbot that responds in both Nepali and English.</p>
263
  <p><strong>यो एक सरल नियम-आधारित च्याटबोट हो जसले नेपाली र अंग्रेजी दुवैमा जवाफ दिन्छ।</strong></p>