Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -258,6 +258,11 @@ def handle_accuse_click(request: gr.Request):
|
|
258 |
# Réinitialiser le chatbot et l'interface utilisateur
|
259 |
return (output, gr.update(visible=False), gr.update(visible=False))
|
260 |
|
|
|
|
|
|
|
|
|
|
|
261 |
def chatbot_interface(request: gr.Request):
|
262 |
chatbot_interface = gr.ChatInterface(
|
263 |
fn=generate,
|
@@ -276,9 +281,8 @@ def chatbot_interface(request: gr.Request):
|
|
276 |
def main(request: gr.Request):
|
277 |
with gr.Blocks(css="footer {visibility: hidden !important} .gradio-container {background-color: #2D4059 !important; color: #FFD460 !important;}",
|
278 |
js=js_func) as demo:
|
279 |
-
accuse_btn = gr.Button("Accuser")
|
280 |
-
accuse_btn.click(handle_accuse_click, inputs=[request])
|
281 |
chat_interface = chatbot_interface(request)
|
|
|
282 |
demo.launch(show_api=False, inline=True)
|
283 |
|
284 |
if __name__ == "__main__":
|
|
|
258 |
# Réinitialiser le chatbot et l'interface utilisateur
|
259 |
return (output, gr.update(visible=False), gr.update(visible=False))
|
260 |
|
261 |
+
def accuse_btn(request: gr.Request):
|
262 |
+
accuse_btn= gr.Button("Accuser")
|
263 |
+
accuse_btn.click(handle_accuse_click, inputs=[request])
|
264 |
+
return accuse_btn
|
265 |
+
|
266 |
def chatbot_interface(request: gr.Request):
|
267 |
chatbot_interface = gr.ChatInterface(
|
268 |
fn=generate,
|
|
|
281 |
def main(request: gr.Request):
|
282 |
with gr.Blocks(css="footer {visibility: hidden !important} .gradio-container {background-color: #2D4059 !important; color: #FFD460 !important;}",
|
283 |
js=js_func) as demo:
|
|
|
|
|
284 |
chat_interface = chatbot_interface(request)
|
285 |
+
accuse_btn = accuse_btn(request)
|
286 |
demo.launch(show_api=False, inline=True)
|
287 |
|
288 |
if __name__ == "__main__":
|