Spaces:
Runtime error
Runtime error
File size: 544 Bytes
53df1f3 093ea09 53df1f3 093ea09 53df1f3 093ea09 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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"))
|