Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -153,6 +153,11 @@ def run_chain(user_query):
|
|
153 |
else:
|
154 |
print("Invalid inputs.")
|
155 |
|
|
|
|
|
|
|
|
|
|
|
156 |
iface = gr.Interface(fn=run_chain, inputs="text", outputs="text", title="AI Response")
|
157 |
-
iface.
|
158 |
-
|
|
|
153 |
else:
|
154 |
print("Invalid inputs.")
|
155 |
|
156 |
+
def button_callback():
|
157 |
+
atexit.register(exit_handler)
|
158 |
+
|
159 |
+
button = gr.inputs.Button(label="Clear Data", callback=button_callback, help="Click me to clear data before exiting this program.")
|
160 |
+
|
161 |
iface = gr.Interface(fn=run_chain, inputs="text", outputs="text", title="AI Response")
|
162 |
+
iface.inputs = [button] # 将按钮添加到输入组件列表中
|
163 |
+
iface.launch()
|