Spaces:
Running
Running
michal
commited on
Commit
·
aa9569d
1
Parent(s):
10fa934
Upload
Browse files- app.py +15 -9
- src/structures/lek_structure.py +14 -3
app.py
CHANGED
@@ -20,7 +20,11 @@ from src.structures.lek_structure import (
|
|
20 |
ORDER_LIST_LEK,
|
21 |
COLUMN_HEADERS_LEK,
|
22 |
DATA_TYPES_LEK,
|
23 |
-
filter_columns_lek
|
|
|
|
|
|
|
|
|
24 |
)
|
25 |
from src.structures.ldek_structure import (
|
26 |
LDEK_ACCS,
|
@@ -112,11 +116,6 @@ with main:
|
|
112 |
|
113 |
with gr.TabItem("🩺 LEK"):
|
114 |
gr.Markdown(LEK_DESC)
|
115 |
-
columns_selector = gr.CheckboxGroup(
|
116 |
-
choices=ORDER_LIST_LEK,
|
117 |
-
label="Select columns to display",
|
118 |
-
value=ORDER_LIST_LEK,
|
119 |
-
)
|
120 |
data_component_ldek = gr.components.Dataframe(
|
121 |
value=LEK_ACCS,
|
122 |
headers=COLUMN_HEADERS_LEK,
|
@@ -126,9 +125,16 @@ with main:
|
|
126 |
visible=True,
|
127 |
column_widths=[400] + [180] +[155] * 22
|
128 |
)
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
|
133 |
|
134 |
with gr.Column():
|
|
|
20 |
ORDER_LIST_LEK,
|
21 |
COLUMN_HEADERS_LEK,
|
22 |
DATA_TYPES_LEK,
|
23 |
+
filter_columns_lek,
|
24 |
+
LEK_ACCS_EN,
|
25 |
+
ORDER_LIST_LEK_EN,
|
26 |
+
COLUMN_HEADERS_LEK_EN,
|
27 |
+
DATA_TYPES_LEK_EN,
|
28 |
)
|
29 |
from src.structures.ldek_structure import (
|
30 |
LDEK_ACCS,
|
|
|
116 |
|
117 |
with gr.TabItem("🩺 LEK"):
|
118 |
gr.Markdown(LEK_DESC)
|
|
|
|
|
|
|
|
|
|
|
119 |
data_component_ldek = gr.components.Dataframe(
|
120 |
value=LEK_ACCS,
|
121 |
headers=COLUMN_HEADERS_LEK,
|
|
|
125 |
visible=True,
|
126 |
column_widths=[400] + [180] +[155] * 22
|
127 |
)
|
128 |
+
gr.Markdown(LEK_DESC)
|
129 |
+
data_component_ldek = gr.components.Dataframe(
|
130 |
+
value=LEK_ACCS_EN,
|
131 |
+
headers=COLUMN_HEADERS_LEK_EN,
|
132 |
+
type="pandas",
|
133 |
+
datatype=DATA_TYPES_LEK_EN,
|
134 |
+
interactive=False,
|
135 |
+
visible=True,
|
136 |
+
column_widths=[400] + [180] +[155] * 22
|
137 |
+
)
|
138 |
|
139 |
|
140 |
with gr.Column():
|
src/structures/lek_structure.py
CHANGED
@@ -56,14 +56,25 @@ def load_json_data(file_path, ORDER_LIST_LEK):
|
|
56 |
return LEK_ACCS
|
57 |
|
58 |
|
59 |
-
# file_path = str(abs_path / "leaderboards/r_lek_report_scores.json")
|
60 |
file_path = str(abs_path / "leaderboards/lek_accs.json")
|
61 |
with open(file_path, 'r', encoding='utf-8') as file:
|
62 |
sample_data = pd.read_json(file_path).iloc[0].to_dict() # Load the first row as a dict
|
63 |
|
64 |
ORDER_LIST_LEK, DATA_TYPES_LEK = generate_ORDER_LIST_LEK_and_data_types(sample_data)
|
65 |
LEK_ACCS = load_json_data(file_path, ORDER_LIST_LEK)
|
66 |
-
|
|
|
|
|
67 |
COLUMN_HEADERS_LEK = ORDER_LIST_LEK
|
68 |
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
return LEK_ACCS
|
57 |
|
58 |
|
|
|
59 |
file_path = str(abs_path / "leaderboards/lek_accs.json")
|
60 |
with open(file_path, 'r', encoding='utf-8') as file:
|
61 |
sample_data = pd.read_json(file_path).iloc[0].to_dict() # Load the first row as a dict
|
62 |
|
63 |
ORDER_LIST_LEK, DATA_TYPES_LEK = generate_ORDER_LIST_LEK_and_data_types(sample_data)
|
64 |
LEK_ACCS = load_json_data(file_path, ORDER_LIST_LEK)
|
65 |
+
LEK_ACCS = LEK_ACCS.style.highlight_max(
|
66 |
+
color = '#E52713',
|
67 |
+
subset=LEK_ACCS.columns[1:]).format(precision=2)
|
68 |
COLUMN_HEADERS_LEK = ORDER_LIST_LEK
|
69 |
|
70 |
+
|
71 |
+
file_path = str(abs_path / "leaderboards/lek_en_accs.json")
|
72 |
+
with open(file_path, 'r', encoding='utf-8') as file:
|
73 |
+
sample_data = pd.read_json(file_path).iloc[0].to_dict() # Load the first row as a dict
|
74 |
+
|
75 |
+
ORDER_LIST_LEK_EN, DATA_TYPES_LEK_EN = generate_ORDER_LIST_LEK_and_data_types(sample_data)
|
76 |
+
LEK_ACCS_EN = load_json_data(file_path, ORDER_LIST_LEK_EN)
|
77 |
+
LEK_ACCS_EN = LEK_ACCS_EN.style.highlight_max(
|
78 |
+
color = '#E52713',
|
79 |
+
subset=LEK_ACCS_EN.columns[1:]).format(precision=2)
|
80 |
+
COLUMN_HEADERS_LEK_EN = ORDER_LIST_LEK_EN
|