Spaces:
Sleeping
Sleeping
zle to wyglada
Browse files
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 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
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 |
|