ldhldh commited on
Commit
98273a5
·
1 Parent(s): 2991b65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -6,6 +6,11 @@ from PIL import Image
6
  import copy
7
  import time
8
  from time import strftime, localtime
 
 
 
 
 
9
 
10
  sample_data = {
11
  "gpus" : {
@@ -77,6 +82,8 @@ sample_data = {
77
  ]
78
  }
79
 
 
 
80
 
81
  user_num = len(sample_data['gpus'].items())
82
  total_gpu = sample_data['total']['total']
 
6
  import copy
7
  import time
8
  from time import strftime, localtime
9
+ from streamlit_autorefresh import st_autorefresh
10
+
11
+ # update every 1 mins
12
+ st_autorefresh(interval= 60 * 1000, key="dataframerefresh")
13
+
14
 
15
  sample_data = {
16
  "gpus" : {
 
82
  ]
83
  }
84
 
85
+ response = requests.post("https://ldhldh-api-for-unity.hf.space/run/predict_7").json()
86
+ sample_data = response["data"][0]
87
 
88
  user_num = len(sample_data['gpus'].items())
89
  total_gpu = sample_data['total']['total']