import gradio as gr def keep_colab_alive(): # Ping Colab's keep-alive endpoint return "Click the link below to open Colab and keep it running!" with gr.Blocks() as demo: gr.Markdown("### Run Colab via Hugging Face Space") gr.HTML( 'Open Colab' ) demo.launch()