Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,19 +2,19 @@ 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/TestScrape"
|
7 |
api = HfApi()
|
8 |
|
9 |
def restart_space():
|
10 |
-
api.restart_space(repo_id=repo_id,
|
11 |
-
|
12 |
|
13 |
demo = gr.Blocks()
|
14 |
|
15 |
with demo:
|
16 |
-
text=gr.Textbox()
|
17 |
-
b1=gr.Button("Restart Space")
|
18 |
-
b1.click(restart_space,outputs=text)
|
19 |
|
20 |
demo.launch()
|
|
|
2 |
import os
|
3 |
from huggingface_hub import HfApi
|
4 |
|
5 |
+
hf_token = os.getenv('hf_token')
|
6 |
repo_id = "duypro247/TestScrape"
|
7 |
api = HfApi()
|
8 |
|
9 |
def restart_space():
|
10 |
+
space_runtime = api.restart_space(repo_id=repo_id, token=hf_token)
|
11 |
+
return str(space_runtime)
|
12 |
|
13 |
demo = gr.Blocks()
|
14 |
|
15 |
with demo:
|
16 |
+
text = gr.Textbox()
|
17 |
+
b1 = gr.Button("Restart Space")
|
18 |
+
b1.click(restart_space, outputs=text)
|
19 |
|
20 |
demo.launch()
|