devilent2 commited on
Commit
75e2722
1 Parent(s): ecdd55f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -85,10 +85,17 @@ def update_cpu_status():
85
 
86
  @spaces.GPU
87
  def update_status():
88
- gpu_status = update_gpu_status()
89
- cpu_status = update_cpu_status()
90
- sys_status=gpu_status+"\n\n"+cpu_status
91
- return sys_status
 
 
 
 
 
 
 
92
 
93
  def refresh_status():
94
  return update_status()
@@ -219,7 +226,8 @@ demo = gr.Blocks()
219
 
220
  #@spaces.GPU
221
  def onload():
222
- return "System Status: "+update_status();
 
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: