import streamlit as st import subprocess import torch def app(): st.title("Hugging Face Space GPU Info") # Check if GPU is available gpu_available = torch.cuda.is_available() if gpu_available: gpu_name = torch.cuda.get_device_name(0) st.write(f"GPU available: {gpu_name}") else: st.write("No GPU available") # Ping the server st.title("Server Ping") ping_output = subprocess.check_output(["ping", "-c", "4", "google.com"]) st.write("Ping output:\n", ping_output.decode("utf-8"))