Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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(
|
9 |
if restart_button:
|
10 |
api.restart_space(repo_id=repo_id)
|
11 |
return "Space restarted!"
|
12 |
return "Space not restarted."
|
13 |
|
14 |
-
|
15 |
-
fn=restart_space,
|
16 |
-
inputs=gr.Button(label="Restart Space"),
|
17 |
-
outputs="text"
|
18 |
-
)
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
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()
|