Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,7 +111,17 @@ demo = gr.Interface(
|
|
| 111 |
],
|
| 112 |
cache_examples=False,
|
| 113 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
if __name__ == "__main__":
|
| 116 |
-
|
| 117 |
|
|
|
|
| 111 |
],
|
| 112 |
cache_examples=False,
|
| 113 |
)
|
| 114 |
+
# Define a function to restart the interface
|
| 115 |
+
def restart_interface():
|
| 116 |
+
# This function can include any logic needed to reset the app's state
|
| 117 |
+
return gr.update()
|
| 118 |
+
|
| 119 |
+
# Add a custom button to restart the interface
|
| 120 |
+
with gr.Blocks() as app:
|
| 121 |
+
with gr.Row():
|
| 122 |
+
demo.render()
|
| 123 |
+
gr.Button("Restart Space").click(fn=restart_interface, inputs=[], outputs=[demo])
|
| 124 |
|
| 125 |
if __name__ == "__main__":
|
| 126 |
+
app.launch()
|
| 127 |
|