homer-meng commited on
Commit
a72929e
·
1 Parent(s): a21d92a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -1,3 +1,19 @@
1
- from test import app # Assuming test.py is in the same directory as app.py
 
 
2
 
3
- app() # Call the app function from test.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import subprocess
3
+ import torch
4
 
5
+ st.title("Hugging Face Space GPU Info")
6
+
7
+ # Check if GPU is available
8
+ gpu_available = torch.cuda.is_available()
9
+
10
+ if gpu_available:
11
+ gpu_name = torch.cuda.get_device_name(0)
12
+ st.write(f"GPU available: {gpu_name}")
13
+ else:
14
+ st.write("No GPU available")
15
+
16
+ # Ping the server
17
+ st.title("Server Ping")
18
+ ping_output = subprocess.check_output(["ping", "-c", "4", "google.com"])
19
+ st.write("Ping output:\n", ping_output.decode("utf-8"))