CultriX commited on
Commit
c2c827a
·
verified ·
1 Parent(s): 74002ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -16
app.py CHANGED
@@ -365,38 +365,43 @@ css = '''
365
  #gallery .grid-wrap{height: 10vh}
366
  #lora_list{background: var(--block-background-fill);padding: 0 1em .3em; font-size: 90%}
367
  .card_internal{display: flex;height: 100px;margin-top: .5em}
368
- .card_internal img{margin-right: 1em}
369
- .styler{--form-gap-width: 0px !important}
370
- #progress{height:30px}
371
- #progress .generating{display:none}
372
- .progress-container {width: 100%;height: 30px;background-color: #f0f0f0;border-radius: 15px;overflow: hidden;margin-bottom: 20px}
373
- .progress-bar {height: 100%;background-color: #4f46e5;width: calc(var(--current) / var(--total) * 100%);transition: width 0.5s ease-in-out}
 
 
374
  '''
 
375
  with gr.Blocks(theme="CultriX/gradio-theme", css=css, delete_cache=(60, 60)) as demo:
376
  gr.Markdown("## Multi-Agent Task Solver with Human-in-the-Loop")
377
-
378
  with gr.Row():
379
- # Chatbot displays conversation messages.
380
- chat_output = gr.Chatbot(label="Conversation", type="messages")
 
 
 
381
  # Hidden state to store the plain-text log.
382
  log_state = gr.State(value="")
383
-
384
  with gr.Row():
385
  with gr.Column(scale=8):
386
  message_input = gr.Textbox(label="Enter your task", placeholder="Type your task here...", lines=3)
387
  with gr.Column(scale=2):
388
  api_key_input = gr.Textbox(label="API Key (optional)", type="password", placeholder="Leave blank to use env variable")
389
-
390
- send_button = gr.Button("Send")
391
-
392
  # The multi_agent_chat function now outputs two values: one for the chat and one for the log.
393
  send_button.click(fn=multi_agent_chat, inputs=[message_input, api_key_input], outputs=[chat_output, log_state])
394
-
395
  with gr.Row():
396
  download_button = gr.Button("Download Log")
397
  download_file = gr.File(label="Download your log file")
398
-
399
- download_button.click(fn=download_log, inputs=log_state, outputs=download_file)
400
 
401
  if __name__ == "__main__":
402
  demo.launch(share=True)
 
 
365
  #gallery .grid-wrap{height: 10vh}
366
  #lora_list{background: var(--block-background-fill);padding: 0 1em .3em; font-size: 90%}
367
  .card_internal{display: flex;height: 100px;margin-top: .5em}
368
+ .card_internal img{margin-right: 1em}.styler{--form-gap-width: 0px !important}
369
+ #progress{height:30px}#progress .generating{display:none}.progress-container {width: 100%;height: 30px;background-color: #f0f0f0;border-radius: 15px;overflow: hidden;margin-bottom: 20px}.progress-bar {height: 100%;background-color: #4f46e5;width: calc(var(--current) / var(--total) * 100%);transition: width 0.5s ease-in-out}
370
+
371
+ /* Add this to make the chatbot bigger */
372
+ .chat-container {
373
+ height: 600px; /* Adjust as needed */
374
+ overflow-y: scroll; /* Add scrollbar if content overflows */
375
+ }
376
  '''
377
+
378
  with gr.Blocks(theme="CultriX/gradio-theme", css=css, delete_cache=(60, 60)) as demo:
379
  gr.Markdown("## Multi-Agent Task Solver with Human-in-the-Loop")
380
+
381
  with gr.Row():
382
+ # Wrap the Chatbot in a div with the class "chat-container"
383
+ with gr.Column(): # Add a column for better layout
384
+ with gr.Box(elem_classes="chat-container"): # Use gr.Box for styling
385
+ chat_output = gr.Chatbot(label="Conversation", type="messages")
386
+
387
  # Hidden state to store the plain-text log.
388
  log_state = gr.State(value="")
389
+
390
  with gr.Row():
391
  with gr.Column(scale=8):
392
  message_input = gr.Textbox(label="Enter your task", placeholder="Type your task here...", lines=3)
393
  with gr.Column(scale=2):
394
  api_key_input = gr.Textbox(label="API Key (optional)", type="password", placeholder="Leave blank to use env variable")
395
+ send_button = gr.Button("Send")
396
+
 
397
  # The multi_agent_chat function now outputs two values: one for the chat and one for the log.
398
  send_button.click(fn=multi_agent_chat, inputs=[message_input, api_key_input], outputs=[chat_output, log_state])
399
+
400
  with gr.Row():
401
  download_button = gr.Button("Download Log")
402
  download_file = gr.File(label="Download your log file")
403
+ download_button.click(fn=download_log, inputs=log_state, outputs=download_file)
 
404
 
405
  if __name__ == "__main__":
406
  demo.launch(share=True)
407
+