winglian commited on
Commit
883f89e
1 Parent(s): bec1c5f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -14
app.py CHANGED
@@ -193,21 +193,37 @@ with demo:
193
  )
194
 
195
 
196
- with gr.Accordion("Validator Stats"):
197
- validator_table = gr.components.Dataframe(
198
- value=[
199
- [uid, int(validator_df[uid][1]), round(validator_df[uid][0], 4)] + [validator_df[uid][-1].get(c.uid) for c in leaderboard_df if c.incentive]
200
- for uid, _ in sorted(
201
- zip(validator_df.keys(), [validator_df[x][1] for x in validator_df.keys()]),
202
- key=lambda x: x[1],
203
- reverse=True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  )
205
- ],
206
- headers=["UID", "Stake (τ)", "V-Trust"] + [f"{c.namespace}/{c.name} ({c.commit[0:8]})" for c in leaderboard_df if c.incentive],
207
- datatype=["number", "number", "number"] + ["number" for c in leaderboard_df if c.incentive],
208
- interactive=False,
209
- visible=True,
210
- )
211
 
212
  def restart_space():
213
  API.restart_space(repo_id=REPO_ID, token=H4_TOKEN)
 
193
  )
194
 
195
 
196
+ with gr.Accordion("Validator Stats"):
197
+ validator_table = gr.components.Dataframe(
198
+ value=[
199
+ [uid, int(validator_df[uid][1]), round(validator_df[uid][0], 4)] + [validator_df[uid][-1].get(c.uid) for c in leaderboard_df if c.incentive and c.competition == competition.id]
200
+ for uid, _ in sorted(
201
+ zip(validator_df.keys(), [validator_df[x][1] for x in validator_df.keys()]),
202
+ key=lambda x: x[1],
203
+ reverse=True
204
+ )
205
+ ],
206
+ headers=["UID", "Stake (τ)", "V-Trust"] + [f"{c.namespace}/{c.name} ({c.commit[0:8]})" for c in leaderboard_df if c.incentive],
207
+ datatype=["number", "number", "number"] + ["number" for c in leaderboard_df if c.incentive],
208
+ interactive=False,
209
+ visible=True,
210
+ )
211
+
212
+ with gr.Accordion("Validator Stats All"):
213
+ validator_table_all = gr.components.Dataframe(
214
+ value=[
215
+ [uid, int(validator_df[uid][1]), round(validator_df[uid][0], 4)] + [validator_df[uid][-1].get(c.uid) for c in leaderboard_df if c.competition == competition.id]
216
+ for uid, _ in sorted(
217
+ zip(validator_df.keys(), [validator_df[x][1] for x in validator_df.keys()]),
218
+ key=lambda x: x[1],
219
+ reverse=True
220
+ )
221
+ ],
222
+ headers=["UID", "Stake (τ)", "V-Trust"] + [f"{c.namespace}/{c.name} ({c.commit[0:8]})" for c in leaderboard_df if c.incentive],
223
+ datatype=["number", "number", "number"] + ["number" for c in leaderboard_df if c.incentive],
224
+ interactive=False,
225
+ visible=True,
226
  )
 
 
 
 
 
 
227
 
228
  def restart_space():
229
  API.restart_space(repo_id=REPO_ID, token=H4_TOKEN)