duypro247 commited on
Commit
4eb6974
1 Parent(s): d7552d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -5,16 +5,16 @@ from huggingface_hub import HfApi
5
  repo_id = "duypro247/TestScrape"
6
  api = HfApi()
7
 
8
- def restart_space(restart_button=False):
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.Button(label="Restart Space"),
17
- outputs="text"
18
- )
19
 
20
- iface.launch()
 
 
 
 
 
5
  repo_id = "duypro247/TestScrape"
6
  api = HfApi()
7
 
8
+ def restart_space():
9
  if restart_button:
10
  api.restart_space(repo_id=repo_id)
11
  return "Space restarted!"
12
  return "Space not restarted."
13
 
14
+ demo = gr.Blocks()
 
 
 
 
15
 
16
+ with demo:
17
+ b1=gr.Button("Restart Space")
18
+ b1.click(restart_space)
19
+
20
+ demo.launch()