Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -35,17 +35,31 @@ def respond(user_input, history):
|
|
35 |
def on_reset_button_click():
|
36 |
llm_svc.store={}
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
51 |
-
|
|
|
35 |
def on_reset_button_click():
|
36 |
llm_svc.store={}
|
37 |
|
38 |
+
|
39 |
+
demo = gr.ChatInterface(
|
40 |
+
fn=respond,
|
41 |
+
additional_inputs=[
|
42 |
+
gr.Button("Reset Chat Memory Cache", elem_id="reset_button")
|
43 |
+
]
|
44 |
+
)
|
45 |
+
|
46 |
+
reset_button = demo.additional_inputs[0]
|
47 |
+
reset_button.click(on_reset_button_click)
|
48 |
+
|
49 |
+
if __name__ == "__main__":
|
50 |
+
demo.launch(share=True)
|
51 |
+
|
52 |
+
# # Define the main block
|
53 |
+
# if __name__ == '__main__':
|
54 |
+
# logging.info("Starting AIVIz Bot")
|
55 |
+
|
56 |
+
# with gr.Blocks() as demo:
|
57 |
+
# # Create the ChatInterface
|
58 |
+
# chat_interface = gr.ChatInterface(fn=respond)
|
59 |
+
# # Create a button and bind the reset function to it
|
60 |
+
# reset_button = gr.Button("Reset Chat Memory Cache")
|
61 |
|
62 |
+
# reset_button.click(on_reset_button_click)
|
63 |
|
64 |
+
# # Launch the interface with a shareable link
|
65 |
+
# demo.launch(share=True)
|