Spaces:
Runtime error
Runtime error
Amit Kumar commited on
Commit ·
0f6aea4
1
Parent(s): fc9a6cd
added markdown, added font
Browse files- app.py +7 -12
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
import os
|
| 4 |
-
|
| 5 |
LEADERBOARD_DIR = "leaderboard_files"
|
| 6 |
LEADERBOARD_FILE = os.path.join(LEADERBOARD_DIR, "leaderboard_data.csv")
|
| 7 |
DESCRIPTION_FILE = "about/description.md"
|
|
@@ -9,16 +9,11 @@ DESCRIPTION_FILE = "about/description.md"
|
|
| 9 |
def load_leaderboard():
|
| 10 |
return pd.read_csv(LEADERBOARD_FILE)
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
return f.read()
|
| 15 |
-
columns_fixed = ["Model Name", "Average Label", "Average Record"]
|
| 16 |
-
|
| 17 |
-
def get_columns_for_shots(selected_shots):
|
| 18 |
-
if not selected_shots:
|
| 19 |
-
return columns_fixed
|
| 20 |
-
return columns_fixed + [col for col in metric_columns if any(shot in col for shot in selected_shots)]
|
| 21 |
|
|
|
|
|
|
|
| 22 |
|
| 23 |
with gr.Blocks() as demo:
|
| 24 |
gr.Markdown("<h1 style='text-align: center;'>🏆 Medical Classification Leaderboard - Beta</h1>")
|
|
@@ -33,8 +28,8 @@ with gr.Blocks() as demo:
|
|
| 33 |
display: block;
|
| 34 |
}
|
| 35 |
"""
|
| 36 |
-
|
| 37 |
-
gr.
|
| 38 |
|
| 39 |
df = load_leaderboard()
|
| 40 |
all_columns = list(df.columns)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
import os
|
| 4 |
+
import markdown
|
| 5 |
LEADERBOARD_DIR = "leaderboard_files"
|
| 6 |
LEADERBOARD_FILE = os.path.join(LEADERBOARD_DIR, "leaderboard_data.csv")
|
| 7 |
DESCRIPTION_FILE = "about/description.md"
|
|
|
|
| 9 |
def load_leaderboard():
|
| 10 |
return pd.read_csv(LEADERBOARD_FILE)
|
| 11 |
|
| 12 |
+
with open(DESCRIPTION_FILE, "r") as f:
|
| 13 |
+
md_text = f.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
html_description = markdown.markdown(md_text, extensions=["tables"])
|
| 16 |
+
columns_fixed = ["Model Name", "Average Label", "Average Record"]
|
| 17 |
|
| 18 |
with gr.Blocks() as demo:
|
| 19 |
gr.Markdown("<h1 style='text-align: center;'>🏆 Medical Classification Leaderboard - Beta</h1>")
|
|
|
|
| 28 |
display: block;
|
| 29 |
}
|
| 30 |
"""
|
| 31 |
+
|
| 32 |
+
gr.HTML(html_description)
|
| 33 |
|
| 34 |
df = load_leaderboard()
|
| 35 |
all_columns = list(df.columns)
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
markdown
|