Spaces:
Running
Running
rename things
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def score_submissions(row):
|
|
37 |
|
38 |
df["scores"] = df.apply(score_submissions, axis=1)
|
39 |
df["code"] = df.apply(lambda x: get_solution_code(day = x["day"], model=x["model"]), axis=1)
|
40 |
-
df["code_md"] = df.code.apply(lambda x: "```python"+x+"```")
|
41 |
|
42 |
df["Runtime (s)"] = df["total_time"].apply(lambda x: str(x)[0:6])
|
43 |
|
@@ -60,7 +60,6 @@ for model in df.model.unique():
|
|
60 |
"Part 2 ⭐️": gold_stars,
|
61 |
}
|
62 |
|
63 |
-
star_df = pd.DataFrame.from_dict(star_summary, orient="index")
|
64 |
|
65 |
def score_to_string(s):
|
66 |
return "⭐️" if s else "❌"
|
@@ -75,7 +74,9 @@ def score_to_string(s):
|
|
75 |
with gr.Blocks() as demo:
|
76 |
md = gr.Markdown("Hello!")
|
77 |
with gr.Tab("Stars"):
|
78 |
-
|
|
|
|
|
79 |
with gr.Tab("Daily"):
|
80 |
|
81 |
# Parse the info to something more readable
|
@@ -87,7 +88,10 @@ with gr.Blocks() as demo:
|
|
87 |
gr_df_daily = gr.DataFrame(df_daily.sort_values(by="day"))
|
88 |
|
89 |
with gr.Tab("Outputs"):
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
92 |
|
93 |
demo.launch()
|
|
|
37 |
|
38 |
df["scores"] = df.apply(score_submissions, axis=1)
|
39 |
df["code"] = df.apply(lambda x: get_solution_code(day = x["day"], model=x["model"]), axis=1)
|
40 |
+
df["code_md"] = df.code.apply(lambda x: "```python\n"+x+"\n```")
|
41 |
|
42 |
df["Runtime (s)"] = df["total_time"].apply(lambda x: str(x)[0:6])
|
43 |
|
|
|
60 |
"Part 2 ⭐️": gold_stars,
|
61 |
}
|
62 |
|
|
|
63 |
|
64 |
def score_to_string(s):
|
65 |
return "⭐️" if s else "❌"
|
|
|
74 |
with gr.Blocks() as demo:
|
75 |
md = gr.Markdown("Hello!")
|
76 |
with gr.Tab("Stars"):
|
77 |
+
star_df = pd.DataFrame.from_dict(star_summary, orient="index")
|
78 |
+
gr_star_df = gr.DataFrame(star_df[["Model", "Total Stars ⭐️"]].sort_values(by="Total Stars ⭐️", ascending=False))
|
79 |
+
gr_star_df = gr.DataFrame(star_df[["Model", "Part 1 ⭐️", "Part 2 ⭐️"]].sort_values(by="Part 1 ⭐️", ascending=False))
|
80 |
with gr.Tab("Daily"):
|
81 |
|
82 |
# Parse the info to something more readable
|
|
|
88 |
gr_df_daily = gr.DataFrame(df_daily.sort_values(by="day"))
|
89 |
|
90 |
with gr.Tab("Outputs"):
|
91 |
+
outputs_df = df[["model", "day", "Runtime (s)", "result"]].rename(columns={"result": "Output"})
|
92 |
+
gr_outputs_df = gr.DataFrame(outputs_df, datatype=["str", "str", "str"])
|
93 |
+
with gr.Tab("Code"):
|
94 |
+
code_df = df[["model", "day", "code_md"]].rename(columns={"code_md": "Code"})
|
95 |
+
gr_code_df = gr.DataFrame(code_df, datatype=['str', 'str', 'markdown'])
|
96 |
|
97 |
demo.launch()
|