RestartSpace / app.py
duypro247's picture
Create app.py
034c56f
raw
history blame
402 Bytes
import gradio as gr
import os
from huggingface_hub import HfApi
repo_id = "duypro247/TestScrape"
api = HfApi()
def restart_space(restart_button):
if restart_button:
api.restart_space(repo_id=repo_id)
return "Space restarted!"
return "Space not restarted."
iface = gr.Interface(
fn=restart_space,
inputs=gr.inputs.Button(label="Restart Space"),
outputs="text"
)