Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -218,24 +218,24 @@ with gr.Blocks() as ux:
|
|
| 218 |
with gr.Column():
|
| 219 |
gr.HTML("""<center><div style='font-size:xx-large;font-weight:900;'>Chatbo</div>""")
|
| 220 |
chatbot=gr.Chatbot(type='messages',show_label=False, show_share_button=False, show_copy_button=True, layout="panel")
|
| 221 |
-
|
| 222 |
mod_c=gr.Dropdown(choices=[n['name'] for n in clients],value='Qwen/Qwen2.5-Coder-32B-Instruct',type='index')
|
| 223 |
-
chat_ux=gr.ChatInterface(fn=agent,chatbot=chatbot,additional_inputs=[mod_c]).load()
|
| 224 |
#chat_ux.additional_inputs=[mod_c]
|
| 225 |
#chat_ux.load()
|
| 226 |
with gr.Row():
|
| 227 |
submit_b = gr.Button()
|
| 228 |
stop_b = gr.Button("Stop")
|
| 229 |
-
|
| 230 |
with gr.Row(visible=False):
|
| 231 |
stt=gr.Textbox()
|
| 232 |
with gr.Column():
|
| 233 |
file_name=gr.Textbox(label="File Name")
|
| 234 |
file_btn=gr.Button("Load Files")
|
| 235 |
file_json=gr.JSON()
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
ux.queue(default_concurrency_limit=20).launch(max_threads=40)
|
| 240 |
|
| 241 |
|
|
|
|
| 218 |
with gr.Column():
|
| 219 |
gr.HTML("""<center><div style='font-size:xx-large;font-weight:900;'>Chatbo</div>""")
|
| 220 |
chatbot=gr.Chatbot(type='messages',show_label=False, show_share_button=False, show_copy_button=True, layout="panel")
|
| 221 |
+
prompt=gr.MultimodalTextbox(label="Prompt",file_count="multiple", file_types=["image"])
|
| 222 |
mod_c=gr.Dropdown(choices=[n['name'] for n in clients],value='Qwen/Qwen2.5-Coder-32B-Instruct',type='index')
|
| 223 |
+
#chat_ux=gr.ChatInterface(fn=agent,chatbot=chatbot,additional_inputs=[mod_c]).load()
|
| 224 |
#chat_ux.additional_inputs=[mod_c]
|
| 225 |
#chat_ux.load()
|
| 226 |
with gr.Row():
|
| 227 |
submit_b = gr.Button()
|
| 228 |
stop_b = gr.Button("Stop")
|
| 229 |
+
clear = gr.ClearButton([chatbot,prompt])
|
| 230 |
with gr.Row(visible=False):
|
| 231 |
stt=gr.Textbox()
|
| 232 |
with gr.Column():
|
| 233 |
file_name=gr.Textbox(label="File Name")
|
| 234 |
file_btn=gr.Button("Load Files")
|
| 235 |
file_json=gr.JSON()
|
| 236 |
+
sub_b = submit_b.click(agent, [chatbot],chatbot)
|
| 237 |
+
sub_p = prompt.submit(agent, [chatbot],chatbot)
|
| 238 |
+
stop_b.click(None,None,None, cancels=[sub_b,sub_p])
|
| 239 |
ux.queue(default_concurrency_limit=20).launch(max_threads=40)
|
| 240 |
|
| 241 |
|