import gradio as gr import spaces import torch @spaces.GPU def gpu_test(): # Placeholder for the future SSH functionality if torch.cuda.is_available(): gpu = torch.cuda.get_device_name(0) return ( "๐Ÿš€ Free SSH for ZeroGPU!\n\n" "๐Ÿ› ๏ธ Dev Mode enabled\n" "๐Ÿ” SSH access is provided through Space Dev Mode.\n" "๐Ÿงช GPU test is currently being used as a placeholder.\n\n" f"GPU: {gpu}" ) return ( "๐Ÿš€ Free SSH for ZeroGPU!\n\n" "๐Ÿ› ๏ธ Dev Mode enabled\n" "๐Ÿ” SSH access is provided through Space Dev Mode.\n" "๐Ÿงช GPU test is currently being used as a placeholder.\n\n" "No GPU allocated." ) demo = gr.Interface( fn=gpu_test, inputs=[], outputs=gr.Textbox(label="Status"), title="๐Ÿš€ Free SSH for ZeroGPU!", description=( "Hugging Face Space Dev Mode provides SSH access. " "The GPU test is only a placeholder for now." ), ) demo.launch()