Spaces:
Runtime error
Runtime error
Create app.py
Browse files
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 |
+
)
|