duypro247 commited on
Commit
034c56f
·
1 Parent(s): 1525ba8

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+ from huggingface_hub import HfApi
4
+
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
+ )