duypro247 commited on
Commit
9a1dd8e
·
1 Parent(s): 034c56f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -5,14 +5,16 @@ from huggingface_hub import HfApi
5
  repo_id = "duypro247/TestScrape"
6
  api = HfApi()
7
 
8
- def restart_space(restart_button):
9
- if restart_button:
10
- api.restart_space(repo_id=repo_id)
11
- return "Space restarted!"
12
- return "Space not restarted."
13
 
14
  iface = gr.Interface(
15
  fn=restart_space,
16
- inputs=gr.inputs.Button(label="Restart Space"),
17
- outputs="text"
18
  )
 
 
 
5
  repo_id = "duypro247/TestScrape"
6
  api = HfApi()
7
 
8
+ def restart_space():
9
+ api.restart_space(repo_id=repo_id)
10
+
11
+
12
+
13
 
14
  iface = gr.Interface(
15
  fn=restart_space,
16
+ inputs=gr.Button(label="Restart Space"),
17
+ inputs.click(restart_space(),outputs="Space Restarted")
18
  )
19
+
20
+ iface.lanch()