Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -85,10 +85,17 @@ def update_cpu_status():
|
|
85 |
|
86 |
@spaces.GPU
|
87 |
def update_status():
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
def refresh_status():
|
94 |
return update_status()
|
@@ -219,7 +226,8 @@ demo = gr.Blocks()
|
|
219 |
|
220 |
#@spaces.GPU
|
221 |
def onload():
|
222 |
-
|
|
|
223 |
|
224 |
|
225 |
with demo:
|
|
|
85 |
|
86 |
@spaces.GPU
|
87 |
def update_status():
|
88 |
+
try:
|
89 |
+
# code that might raise an error
|
90 |
+
gpu_status = update_gpu_status()
|
91 |
+
cpu_status = update_cpu_status()
|
92 |
+
sys_status=gpu_status+"\n\n"+cpu_status
|
93 |
+
return sys_status
|
94 |
+
except Exception as e:
|
95 |
+
# catch all other exceptions
|
96 |
+
print(f"An error occurred: {e}")
|
97 |
+
|
98 |
+
|
99 |
|
100 |
def refresh_status():
|
101 |
return update_status()
|
|
|
226 |
|
227 |
#@spaces.GPU
|
228 |
def onload():
|
229 |
+
print('onload')
|
230 |
+
#return "System Status: "+update_status();
|
231 |
|
232 |
|
233 |
with demo:
|