ThomasSimonini's picture
Update app.py
d9c41f3
raw
history blame contribute delete
624 Bytes
import os
import gradio as gr
from huggingface_hub import HfApi, hf_hub_download, snapshot_download
from apscheduler.schedulers.background import BackgroundScheduler
HF_TOKEN = os.environ.get("HF_TOKEN")
api = HfApi(token=HF_TOKEN)
def restart():
api.restart_space(repo_id="huggingface-projects/Deep-Reinforcement-Learning-Leaderboard")
print("Restart")
scheduler = BackgroundScheduler()
# Refresh every hour
scheduler.add_job(restart, 'interval', seconds=3600)
scheduler.start()
def greet(name):
return "Hello " + name + "!!"
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()