am commited on
Commit
b86b064
·
1 Parent(s): 31ff107
Files changed (1) hide show
  1. app.py +40 -40
app.py CHANGED
@@ -110,47 +110,47 @@ with gr.Blocks() as demo:
110
  )
111
  ex.dataset.show_label = False
112
 
113
- with gr.Column(scale=2):
114
- chat_interface = gr.ChatInterface(fn=model_inference,
115
- type="messages",
116
- chatbot=gr.Chatbot(type="messages", label="AI", render_markdown=True, sanitize_html=False, allow_tags=True, height='35vw', container=False, show_share_button=False),
117
- textbox=textbox,
118
- additional_inputs=image_input,
119
- multimodal=False,
120
- fill_height=False,
121
- show_api=False,
122
- )
123
- gr.HTML('<span style="color:lightgray">Start with a full prompt: Find abnormalities and support devices.<br>\
124
- Follow up with additial questions, such as Provide differentials or Write a structured report.<br>')
125
-
126
-
127
-
128
- # Clear chat history when an example is selected (keep example-populated inputs intact)
129
- ex.load_input_event.then(
130
- lambda: ([], [], [], None),
131
- None,
132
- [chat_interface.chatbot, chat_interface.chatbot_state, chat_interface.chatbot_value, chat_interface.saved_input],
133
- queue=False,
134
- show_api=False,
135
- )
136
 
137
- # Clear chat history when a new image is uploaded via the image input
138
- image_input.upload(
139
- lambda: ([], [], [], None, DEFAULT_PROMPT),
140
- None,
141
- [chat_interface.chatbot, chat_interface.chatbot_state, chat_interface.chatbot_value, chat_interface.saved_input, textbox],
142
- queue=False,
143
- show_api=False,
144
- )
145
-
146
- # Clear everything on Clear button click
147
- clear_btn.click(
148
- lambda: ([], [], [], None, "", None),
149
- None,
150
- [chat_interface.chatbot, chat_interface.chatbot_state, chat_interface.chatbot_value, chat_interface.saved_input, textbox, image_input],
151
- queue=False,
152
- show_api=False,
153
- )
154
 
155
 
156
 
 
110
  )
111
  ex.dataset.show_label = False
112
 
113
+ # with gr.Column(scale=2):
114
+ # chat_interface = gr.ChatInterface(fn=model_inference,
115
+ # type="messages",
116
+ # chatbot=gr.Chatbot(type="messages", label="AI", render_markdown=True, sanitize_html=False, allow_tags=True, height='35vw', container=False, show_share_button=False),
117
+ # textbox=textbox,
118
+ # additional_inputs=image_input,
119
+ # multimodal=False,
120
+ # fill_height=False,
121
+ # show_api=False,
122
+ # )
123
+ # gr.HTML('<span style="color:lightgray">Start with a full prompt: Find abnormalities and support devices.<br>\
124
+ # Follow up with additial questions, such as Provide differentials or Write a structured report.<br>')
125
+
126
+
127
+
128
+ # # Clear chat history when an example is selected (keep example-populated inputs intact)
129
+ # ex.load_input_event.then(
130
+ # lambda: ([], [], [], None),
131
+ # None,
132
+ # [chat_interface.chatbot, chat_interface.chatbot_state, chat_interface.chatbot_value, chat_interface.saved_input],
133
+ # queue=False,
134
+ # show_api=False,
135
+ # )
136
 
137
+ # # Clear chat history when a new image is uploaded via the image input
138
+ # image_input.upload(
139
+ # lambda: ([], [], [], None, DEFAULT_PROMPT),
140
+ # None,
141
+ # [chat_interface.chatbot, chat_interface.chatbot_state, chat_interface.chatbot_value, chat_interface.saved_input, textbox],
142
+ # queue=False,
143
+ # show_api=False,
144
+ # )
145
+
146
+ # # Clear everything on Clear button click
147
+ # clear_btn.click(
148
+ # lambda: ([], [], [], None, "", None),
149
+ # None,
150
+ # [chat_interface.chatbot, chat_interface.chatbot_state, chat_interface.chatbot_value, chat_interface.saved_input, textbox, image_input],
151
+ # queue=False,
152
+ # show_api=False,
153
+ # )
154
 
155
 
156