Rohith1112 commited on
Commit
8b6818e
·
verified ·
1 Parent(s): 4d50783

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -17
app.py CHANGED
@@ -81,28 +81,19 @@ def upload_image(image):
81
  # Gradio UI
82
  with gr.Blocks(theme="soft") as chat_ui:
83
  with gr.Row():
84
- # Static Sidebar
85
- with gr.Column(scale=1, min_width=200):
86
- gr.Markdown("### ChatGPT Menu")
87
- gr.Markdown("#### Today")
88
- gr.Markdown("- Permission error fix")
89
- gr.Markdown("#### Yesterday")
90
- gr.Markdown("- Invalid Characters Fix")
91
- gr.Markdown("- Machi UI Design Request")
92
- gr.Markdown("- UI Design Summary")
93
- gr.Markdown("#### Previous 7 Days")
94
- gr.Markdown("- Uber and Netflix BI Visualization")
95
- gr.Markdown("#### Upgrade Plan")
96
- gr.Markdown("More access to the best models")
97
-
98
- # Center Chat Area
99
  with gr.Column(scale=4):
100
  gr.Markdown("### ICliniq AI-Powered Medical Image Analysis")
101
- chat_list = gr.Chatbot(value=[], label="Chat History", elem_id="chat-history") # Dynamic chat
102
  uploaded_image = gr.File(label="Upload .npy Image", type="filepath")
103
  upload_status = gr.Textbox(label="Status", interactive=False)
104
  extracted_image = gr.Image(label="Extracted Images")
105
  question_input = gr.Textbox(label="Ask a question", placeholder="Ask something about the image...")
106
  submit_button = gr.Button("Send")
107
 
108
-
 
 
 
 
 
 
81
  # Gradio UI
82
  with gr.Blocks(theme="soft") as chat_ui:
83
  with gr.Row():
84
+ # Dynamic Chat Area
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  with gr.Column(scale=4):
86
  gr.Markdown("### ICliniq AI-Powered Medical Image Analysis")
87
+ chat_list = gr.Chatbot(value=[], label="Chat History", type='messages', elem_id="chat-history") # Dynamic chat with messages type
88
  uploaded_image = gr.File(label="Upload .npy Image", type="filepath")
89
  upload_status = gr.Textbox(label="Status", interactive=False)
90
  extracted_image = gr.Image(label="Extracted Images")
91
  question_input = gr.Textbox(label="Ask a question", placeholder="Ask something about the image...")
92
  submit_button = gr.Button("Send")
93
 
94
+ # Upload and Processing Interactions
95
+ uploaded_image.upload(upload_image, uploaded_image, [upload_status, extracted_image])
96
+ submit_button.click(chat_interface, question_input, chat_list)
97
+ question_input.submit(chat_interface, question_input, chat_list)
98
+
99
+ chat_ui.launch()