Ankitajadhav commited on
Commit
a4674f5
·
verified ·
1 Parent(s): 6628b94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -111,7 +111,17 @@ demo = gr.Interface(
111
  ],
112
  cache_examples=False,
113
  )
 
 
 
 
 
 
 
 
 
 
114
 
115
  if __name__ == "__main__":
116
- demo.launch()
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