ldhldh commited on
Commit
4454164
·
1 Parent(s): a0e4761

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -80,11 +80,16 @@ sample_data = {
80
  ]
81
  }
82
 
83
- response = requests.post("https://ldhldh-api-for-unity.hf.space/run/predict_7", json={
84
- "data": [
85
- ]}).json()
 
 
86
 
87
- sample_data = response["data"][0]
 
 
 
88
 
89
  user_num = len(sample_data['gpus'].items())
90
  total_gpu = sample_data['total']['total']
@@ -299,6 +304,3 @@ st.bar_chart(call_data)
299
 
300
  st.title('Previous Blocks')
301
  st.table(pd.DataFrame(sample_data['chain']))
302
-
303
- # update every 1 mins
304
- st_autorefresh(interval= 60 * 1000, key="dataframerefresh")
 
80
  ]
81
  }
82
 
83
+ def update():
84
+ response = requests.post("https://ldhldh-api-for-unity.hf.space/run/predict_7", json={
85
+ "data": [
86
+ ]}).json()
87
+ sample_data = response["data"][0]
88
 
89
+ st.button('reload')
90
+
91
+ if st.button('데이터 보기'):
92
+ update()
93
 
94
  user_num = len(sample_data['gpus'].items())
95
  total_gpu = sample_data['total']['total']
 
304
 
305
  st.title('Previous Blocks')
306
  st.table(pd.DataFrame(sample_data['chain']))