mrfakename's picture
Create app.py
7724338
raw
history blame
No virus
534 Bytes
import time
last_run = 0
import gradio as gr
def reboot():
global last_run
current_time = time.time()
if current_time - last_run >= 300:
last_run = current_time
else:
gr.Error("The Space has already been rebooted recently")
with gr.Blocks() as demo:
gr.Markdown("# Request a Reboot of [OpenDalle v1.1 GPU Demo](https://huggingface.co/spaces/mrfakename/OpenDalleV1.1-GPU-Demo)\n\nIs the demo not working? Request a reboot!")
btn = gr.Button("Reboot")
btn.click(reboot)
demo.launch()