rainbow-canvas / app.py
homer-meng's picture
Update app.py
a72929e
raw
history blame
484 Bytes
import streamlit as st
import subprocess
import torch
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"))