Jack Monas
commited on
Commit
·
bba381d
1
Parent(s):
015e45c
rules
Browse files
app.py
CHANGED
@@ -64,7 +64,6 @@ def scoring_section():
|
|
64 |
"respective Hugging Face submission servers. Below is a preview of the overall leaderboard format:"
|
65 |
)
|
66 |
|
67 |
-
# Sample data
|
68 |
data = {
|
69 |
"Rank": [1, 2, 3],
|
70 |
"Team Name": ["Team Alpha", "Team Beta", "Team Gamma"],
|
@@ -74,9 +73,9 @@ def scoring_section():
|
|
74 |
"Total Points": [40, 28, 20],
|
75 |
}
|
76 |
|
77 |
-
|
78 |
|
79 |
-
# Custom CSS for a dark
|
80 |
table_css = """
|
81 |
<style>
|
82 |
.dark-table {
|
@@ -84,40 +83,35 @@ def scoring_section():
|
|
84 |
width: 100%;
|
85 |
font-size: 1em;
|
86 |
margin: 10px 0;
|
87 |
-
color: #dddddd; /* Light text for dark background */
|
88 |
}
|
89 |
.dark-table th {
|
90 |
-
background-color: #333333;
|
91 |
-
color: #ffffff;
|
92 |
padding: 8px;
|
93 |
text-align: center;
|
94 |
font-weight: bold;
|
95 |
}
|
96 |
.dark-table td {
|
97 |
-
border: 1px solid #444444;
|
98 |
padding: 8px;
|
99 |
text-align: center;
|
100 |
}
|
101 |
.dark-table tr:nth-child(even) {
|
102 |
-
background-color: #2b2b2b;
|
103 |
}
|
104 |
.dark-table tr:nth-child(odd) {
|
105 |
-
background-color: #1f1f1f;
|
106 |
}
|
107 |
</style>
|
108 |
"""
|
109 |
|
110 |
-
# Convert DataFrame to HTML
|
111 |
-
styled_html =
|
112 |
-
index=False,
|
113 |
-
classes="dark-table" # Use the .dark-table CSS
|
114 |
-
)
|
115 |
|
116 |
-
#
|
117 |
st.markdown(table_css + styled_html, unsafe_allow_html=True)
|
118 |
|
119 |
-
|
120 |
-
|
121 |
def main():
|
122 |
st.set_page_config(page_title="World Model Challenge")
|
123 |
|
|
|
64 |
"respective Hugging Face submission servers. Below is a preview of the overall leaderboard format:"
|
65 |
)
|
66 |
|
|
|
67 |
data = {
|
68 |
"Rank": [1, 2, 3],
|
69 |
"Team Name": ["Team Alpha", "Team Beta", "Team Gamma"],
|
|
|
73 |
"Total Points": [40, 28, 20],
|
74 |
}
|
75 |
|
76 |
+
df = pd.DataFrame(data)
|
77 |
|
78 |
+
# Custom CSS for a dark-themed table
|
79 |
table_css = """
|
80 |
<style>
|
81 |
.dark-table {
|
|
|
83 |
width: 100%;
|
84 |
font-size: 1em;
|
85 |
margin: 10px 0;
|
86 |
+
color: #dddddd; /* Light text for a dark background */
|
87 |
}
|
88 |
.dark-table th {
|
89 |
+
background-color: #333333;
|
90 |
+
color: #ffffff;
|
91 |
padding: 8px;
|
92 |
text-align: center;
|
93 |
font-weight: bold;
|
94 |
}
|
95 |
.dark-table td {
|
96 |
+
border: 1px solid #444444;
|
97 |
padding: 8px;
|
98 |
text-align: center;
|
99 |
}
|
100 |
.dark-table tr:nth-child(even) {
|
101 |
+
background-color: #2b2b2b;
|
102 |
}
|
103 |
.dark-table tr:nth-child(odd) {
|
104 |
+
background-color: #1f1f1f;
|
105 |
}
|
106 |
</style>
|
107 |
"""
|
108 |
|
109 |
+
# Convert the DataFrame to HTML, using our custom CSS class, and hiding the index
|
110 |
+
styled_html = df.to_html(index=False, classes="dark-table")
|
|
|
|
|
|
|
111 |
|
112 |
+
# Display the combined CSS + HTML
|
113 |
st.markdown(table_css + styled_html, unsafe_allow_html=True)
|
114 |
|
|
|
|
|
115 |
def main():
|
116 |
st.set_page_config(page_title="World Model Challenge")
|
117 |
|