bulubula commited on
Commit
7a64cd9
1 Parent(s): c62abb4

zle to wyglada

Browse files
Files changed (1) hide show
  1. app.py +26 -25
app.py CHANGED
@@ -84,31 +84,32 @@ def main():
84
  competition_summaries, model_evaluations, st.session_state.last_update_time = load_competition_data(st.session_state.last_update_time)
85
 
86
  for competition in COMPETITIONS:
87
- if COMPETITIONS[competition]["project"] in competitions_id:
88
- if not competition_summaries[competition].empty:
89
- # get all winning hotkeys and number of wins
90
- winning_hotkeys = competition_summaries[competition]["Winning Hotkey"].value_counts()
91
-
92
- # if not empty, get the best hotkey
93
- if not winning_hotkeys.empty:
94
- best_hotkey = winning_hotkeys.idxmax()
95
-
96
- # Filter models for the best hotkey
97
- best_model_filtered = model_evaluations[competition][model_evaluations[competition]["Miner hotkey"] == best_hotkey]
98
-
99
- # Check if the filtered DataFrame is not empty
100
- if not best_model_filtered.empty:
101
- best_model = best_model_filtered.iloc[0]
102
- st.session_state.leader_info[competition] = update_leader_info(st.session_state.leader_info, competition, best_model)
103
- else:
104
- st.warning(f"No model found for the best hotkey: {best_hotkey} in competition {competition}.")
105
-
106
- else:
107
- st.session_state.leader_info[competition] = {
108
- "Miner hotkey": "N/A",
109
- "Date": "N/A",
110
- "Days on Top": "N/A"
111
- }
 
112
  else:
113
  competition_summaries, model_evaluations, _ = load_competition_data(st.session_state.last_update_time)
114
 
 
84
  competition_summaries, model_evaluations, st.session_state.last_update_time = load_competition_data(st.session_state.last_update_time)
85
 
86
  for competition in COMPETITIONS:
87
+ if COMPETITIONS[competition]["project"] not in competitions_id:
88
+ continue
89
+ if not competition_summaries[competition].empty:
90
+ # get all winning hotkeys and number of wins
91
+ winning_hotkeys = competition_summaries[competition]["Winning Hotkey"].value_counts()
92
+
93
+ # if not empty, get the best hotkey
94
+ if not winning_hotkeys.empty:
95
+ best_hotkey = winning_hotkeys.idxmax()
96
+
97
+ # Filter models for the best hotkey
98
+ best_model_filtered = model_evaluations[competition][model_evaluations[competition]["Miner hotkey"] == best_hotkey]
99
+
100
+ # Check if the filtered DataFrame is not empty
101
+ if not best_model_filtered.empty:
102
+ best_model = best_model_filtered.iloc[0]
103
+ st.session_state.leader_info[competition] = update_leader_info(st.session_state.leader_info, competition, best_model)
104
+ else:
105
+ st.warning(f"No model found for the best hotkey: {best_hotkey} in competition {competition}.")
106
+
107
+ else:
108
+ st.session_state.leader_info[competition] = {
109
+ "Miner hotkey": "N/A",
110
+ "Date": "N/A",
111
+ "Days on Top": "N/A"
112
+ }
113
  else:
114
  competition_summaries, model_evaluations, _ = load_competition_data(st.session_state.last_update_time)
115