Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -396,12 +396,13 @@ with gr.Blocks(title="Backend-Focused LLaMA/Mistral CRUD Assistant", theme=gr.th
|
|
| 396 |
return gr.update(choices=labels, value=new_selected)
|
| 397 |
|
| 398 |
# wire rename button
|
| 399 |
-
rename_btn.click(rename_session_cb, inputs=[edit_title_box, session_list], outputs=session_list)
|
| 400 |
|
| 401 |
# wire other small buttons
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
|
|
|
| 405 |
|
| 406 |
gr.Markdown("### 🤖 Model")
|
| 407 |
model_choice = gr.Dropdown(
|
|
@@ -439,10 +440,10 @@ with gr.Blocks(title="Backend-Focused LLaMA/Mistral CRUD Assistant", theme=gr.th
|
|
| 439 |
regen_btn = gr.Button("Regenerate 🔁", variant="secondary")
|
| 440 |
|
| 441 |
# Hook up callbacks (preserve your existing wires)
|
| 442 |
-
refresh_btn.click(refresh_sessions_cb, outputs=session_list)
|
| 443 |
new_btn.click(new_chat_cb, outputs=[session_list, chatbot, user_box])
|
| 444 |
-
del_btn.click(delete_chat_cb, inputs=session_list, outputs=[session_list, chatbot])
|
| 445 |
-
session_list.change(load_session_cb, inputs=session_list, outputs=chatbot)
|
| 446 |
|
| 447 |
send_btn.click(
|
| 448 |
send_cb,
|
|
@@ -459,7 +460,7 @@ with gr.Blocks(title="Backend-Focused LLaMA/Mistral CRUD Assistant", theme=gr.th
|
|
| 459 |
regen_btn.click(
|
| 460 |
regenerate_cb,
|
| 461 |
inputs=[session_list, system_box, max_tokens, temperature, top_p, model_choice, dataset_choice],
|
| 462 |
-
outputs=chatbot
|
| 463 |
)
|
| 464 |
|
| 465 |
if __name__ == "__main__":
|
|
|
|
| 396 |
return gr.update(choices=labels, value=new_selected)
|
| 397 |
|
| 398 |
# wire rename button
|
| 399 |
+
rename_btn.click(rename_session_cb, inputs=[edit_title_box, session_list], outputs=[session_list])
|
| 400 |
|
| 401 |
# wire other small buttons
|
| 402 |
+
# <-- FIXED: outputs must be component variables, not gr.update(...) dicts
|
| 403 |
+
new_btn.click(new_chat_cb, outputs=[session_list, chatbot, user_box])
|
| 404 |
+
del_btn.click(delete_chat_cb, inputs=[session_list], outputs=[session_list, chatbot])
|
| 405 |
+
refresh_btn.click(refresh_sessions_cb, outputs=[session_list])
|
| 406 |
|
| 407 |
gr.Markdown("### 🤖 Model")
|
| 408 |
model_choice = gr.Dropdown(
|
|
|
|
| 440 |
regen_btn = gr.Button("Regenerate 🔁", variant="secondary")
|
| 441 |
|
| 442 |
# Hook up callbacks (preserve your existing wires)
|
| 443 |
+
refresh_btn.click(refresh_sessions_cb, outputs=[session_list])
|
| 444 |
new_btn.click(new_chat_cb, outputs=[session_list, chatbot, user_box])
|
| 445 |
+
del_btn.click(delete_chat_cb, inputs=[session_list], outputs=[session_list, chatbot])
|
| 446 |
+
session_list.change(load_session_cb, inputs=[session_list], outputs=[chatbot])
|
| 447 |
|
| 448 |
send_btn.click(
|
| 449 |
send_cb,
|
|
|
|
| 460 |
regen_btn.click(
|
| 461 |
regenerate_cb,
|
| 462 |
inputs=[session_list, system_box, max_tokens, temperature, top_p, model_choice, dataset_choice],
|
| 463 |
+
outputs=[chatbot]
|
| 464 |
)
|
| 465 |
|
| 466 |
if __name__ == "__main__":
|