Spaces:
Runtime error
Runtime error
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" | |
) | |