Spaces:
Runtime error
Runtime error
add weight to evaluation stats
Browse files
app.py
CHANGED
@@ -147,10 +147,12 @@ def get_scores(uids: typing.List[int]) -> typing.Dict[int, typing.Dict[str, typi
|
|
147 |
avg_loss, avg_loss_fresh = get_float_score(f"uid_data.{uid}", history)
|
148 |
win_rate, win_rate_fresh = get_float_score(f"win_rate_data.{uid}", history)
|
149 |
win_total, win_total_fresh = get_float_score(f"win_total_data.{uid}", history)
|
|
|
150 |
result[uid] = {
|
151 |
"avg_loss": avg_loss,
|
152 |
"win_rate": win_rate,
|
153 |
"win_total": win_total,
|
|
|
154 |
"fresh": avg_loss_fresh and win_rate_fresh and win_total_fresh
|
155 |
}
|
156 |
if len(result.keys()) == len(uids):
|
@@ -199,9 +201,10 @@ def get_next_update():
|
|
199 |
def leaderboard_data(show_stale: bool):
|
200 |
value = [
|
201 |
[
|
202 |
-
f'[{c.namespace}/{c.name}](https://huggingface.co/{c.namespace}/{c.name})',
|
203 |
format_score(c.uid, scores, "win_rate"),
|
204 |
format_score(c.uid, scores, "avg_loss"),
|
|
|
205 |
c.uid,
|
206 |
c.block
|
207 |
] for c in leaderboard_df if scores[c.uid]["fresh"] or show_stale
|
@@ -218,7 +221,7 @@ with demo:
|
|
218 |
gr.HTML(value=get_next_update())
|
219 |
|
220 |
gr.Label(
|
221 |
-
value={ f"{c.namespace}/{c.name} · ${round(c.emission * tao_price, 2):,} (τ{round(c.emission, 2):,})": c.incentive for c in leaderboard_df},
|
222 |
num_top_classes=10,
|
223 |
)
|
224 |
|
@@ -227,7 +230,7 @@ with demo:
|
|
227 |
show_stale = gr.Checkbox(label="Show Stale", interactive=True)
|
228 |
leaderboard_table = gr.components.Dataframe(
|
229 |
value=leaderboard_data(show_stale.value),
|
230 |
-
headers=["Name", "Win Rate", "Average Loss", "UID", "Block"],
|
231 |
datatype=["markdown", "number", "number", "number", "number", "number"],
|
232 |
elem_id="leaderboard-table",
|
233 |
interactive=False,
|
|
|
147 |
avg_loss, avg_loss_fresh = get_float_score(f"uid_data.{uid}", history)
|
148 |
win_rate, win_rate_fresh = get_float_score(f"win_rate_data.{uid}", history)
|
149 |
win_total, win_total_fresh = get_float_score(f"win_total_data.{uid}", history)
|
150 |
+
weight, weight_fresh = get_float_score(f"weight_data.{uid}", history)
|
151 |
result[uid] = {
|
152 |
"avg_loss": avg_loss,
|
153 |
"win_rate": win_rate,
|
154 |
"win_total": win_total,
|
155 |
+
"weight": weight,
|
156 |
"fresh": avg_loss_fresh and win_rate_fresh and win_total_fresh
|
157 |
}
|
158 |
if len(result.keys()) == len(uids):
|
|
|
201 |
def leaderboard_data(show_stale: bool):
|
202 |
value = [
|
203 |
[
|
204 |
+
f'[{c.namespace}/{c.name} ({c.commit[-6:]})](https://huggingface.co/{c.namespace}/{c.name}/commit/{c.commit})',
|
205 |
format_score(c.uid, scores, "win_rate"),
|
206 |
format_score(c.uid, scores, "avg_loss"),
|
207 |
+
format_score(c.uid, scores, "weight"),
|
208 |
c.uid,
|
209 |
c.block
|
210 |
] for c in leaderboard_df if scores[c.uid]["fresh"] or show_stale
|
|
|
221 |
gr.HTML(value=get_next_update())
|
222 |
|
223 |
gr.Label(
|
224 |
+
value={ f"{c.namespace}/{c.name} ({c.commit[-6:]}) · ${round(c.emission * tao_price, 2):,} (τ{round(c.emission, 2):,})": c.incentive for c in leaderboard_df},
|
225 |
num_top_classes=10,
|
226 |
)
|
227 |
|
|
|
230 |
show_stale = gr.Checkbox(label="Show Stale", interactive=True)
|
231 |
leaderboard_table = gr.components.Dataframe(
|
232 |
value=leaderboard_data(show_stale.value),
|
233 |
+
headers=["Name", "Win Rate", "Average Loss", "Weight", "UID", "Block"],
|
234 |
datatype=["markdown", "number", "number", "number", "number", "number"],
|
235 |
elem_id="leaderboard-table",
|
236 |
interactive=False,
|