Cascade Bot commited on
Commit
677ea96
Β·
1 Parent(s): abf07ad

refactor: simplify Gradio interface to resolve asset loading issues

Browse files

- Replace custom theme with default theme
- Remove custom CSS styling
- Simplify component configurations
- Remove unnecessary parameters

Files changed (1) hide show
  1. app.py +6 -66
app.py CHANGED
@@ -195,53 +195,7 @@ class ChatInterface:
195
  """Create the Gradio interface."""
196
  with gr.Blocks(
197
  title="Advanced Agentic System",
198
- theme=gr.themes.Soft(
199
- primary_hue="blue",
200
- secondary_hue="indigo",
201
- neutral_hue="slate",
202
- ),
203
- css="""
204
- .gradio-container {
205
- max-width: 1200px !important;
206
- margin: auto;
207
- padding: 20px;
208
- }
209
- .chat-message {
210
- padding: 15px;
211
- border-radius: 12px;
212
- margin-bottom: 12px;
213
- line-height: 1.5;
214
- }
215
- .user-message {
216
- background-color: var(--neutral-100);
217
- border: 1px solid var(--neutral-200);
218
- }
219
- .assistant-message {
220
- background-color: var(--primary-50);
221
- border: 1px solid var(--primary-100);
222
- }
223
- .message-wrap {
224
- max-width: 90%;
225
- }
226
- .chat-window {
227
- height: 600px;
228
- overflow-y: auto;
229
- padding: 20px;
230
- border-radius: 15px;
231
- border: 1px solid var(--neutral-200);
232
- background: var(--background-fill-primary);
233
- }
234
- footer {display: none !important;}
235
- .gradio-container {min-height: 100vh !important;}
236
- .main {
237
- flex-grow: 1;
238
- padding: 2rem;
239
- }
240
- .message {
241
- padding: 1rem;
242
- margin: 0.5rem 0;
243
- }
244
- """
245
  ) as interface:
246
  gr.Markdown("""
247
  # πŸ€– Advanced Agentic System Chat Interface
@@ -265,42 +219,28 @@ class ChatInterface:
265
  chatbot = gr.Chatbot(
266
  label="Chat History",
267
  height=600,
268
- bubble_full_width=False,
269
  show_copy_button=True,
270
- render_markdown=True,
271
- container=True,
272
- elem_classes=["chat-window"],
273
- type="messages",
274
- show_label=False,
275
  )
276
 
277
  with gr.Row():
278
  msg = gr.Textbox(
279
  label="Message",
280
  placeholder="Chat with the Agentic System...",
281
- lines=2,
282
- max_lines=10,
283
- show_label=False,
284
- container=False,
285
- scale=9
286
  )
287
  submit = gr.Button(
288
  "Send πŸš€",
289
- scale=1,
290
  variant="primary"
291
  )
292
 
293
- with gr.Row(equal_height=True):
294
  clear = gr.ClearButton(
295
  [msg, chatbot],
296
- value="Clear Chat πŸ—‘οΈ",
297
- variant="secondary",
298
- scale=1
299
  )
300
  retry = gr.Button(
301
- "Retry Last πŸ”„",
302
- variant="secondary",
303
- scale=1
304
  )
305
 
306
  async def respond(message, history):
 
195
  """Create the Gradio interface."""
196
  with gr.Blocks(
197
  title="Advanced Agentic System",
198
+ theme=gr.themes.Default()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  ) as interface:
200
  gr.Markdown("""
201
  # πŸ€– Advanced Agentic System Chat Interface
 
219
  chatbot = gr.Chatbot(
220
  label="Chat History",
221
  height=600,
 
222
  show_copy_button=True,
223
+ render_markdown=True
 
 
 
 
224
  )
225
 
226
  with gr.Row():
227
  msg = gr.Textbox(
228
  label="Message",
229
  placeholder="Chat with the Agentic System...",
230
+ lines=2
 
 
 
 
231
  )
232
  submit = gr.Button(
233
  "Send πŸš€",
 
234
  variant="primary"
235
  )
236
 
237
+ with gr.Row():
238
  clear = gr.ClearButton(
239
  [msg, chatbot],
240
+ value="Clear Chat πŸ—‘οΈ"
 
 
241
  )
242
  retry = gr.Button(
243
+ "Retry Last πŸ”„"
 
 
244
  )
245
 
246
  async def respond(message, history):