Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
from huggingface_hub import HfApi
|
4 |
+
|
5 |
+
hf_token = os.getenv('hf_token')
|
6 |
+
repo_id = "duypro247/VNAScrape"
|
7 |
+
api = HfApi()
|
8 |
+
|
9 |
+
def restart_space():
|
10 |
+
space_runtime = api.restart_space(repo_id=repo_id, token=hf_token)
|
11 |
+
|
12 |
+
demo = gr.Blocks()
|
13 |
+
|
14 |
+
with demo:
|
15 |
+
text = gr.Textbox()
|
16 |
+
b1 = gr.Button("Restart Space")
|
17 |
+
b1.click(restart_space)
|
18 |
+
|
19 |
+
demo.launch()
|