innocent-charles
commited on
Commit
β’
14b6298
1
Parent(s):
12c0900
Update app.py
Browse files
app.py
CHANGED
@@ -12,10 +12,8 @@ NON_BENCHMARK_COLS = ["Open?", "Publisher"]
|
|
12 |
|
13 |
def extract_table_and_format_from_markdown_text(markdown_table: str) -> pd.DataFrame:
|
14 |
"""Extracts a table from a markdown text and formats it as a pandas DataFrame.
|
15 |
-
|
16 |
Args:
|
17 |
text (str): Markdown text containing a table.
|
18 |
-
|
19 |
Returns:
|
20 |
pd.DataFrame: Table as pandas DataFrame.
|
21 |
"""
|
@@ -39,15 +37,12 @@ def extract_table_and_format_from_markdown_text(markdown_table: str) -> pd.DataF
|
|
39 |
|
40 |
def extract_markdown_table_from_multiline(multiline: str, table_headline: str, next_headline_start: str = "#") -> str:
|
41 |
"""Extracts the markdown table from a multiline string.
|
42 |
-
|
43 |
Args:
|
44 |
multiline (str): content of README.md file.
|
45 |
table_headline (str): Headline of the table in the README.md file.
|
46 |
next_headline_start (str, optional): Start of the next headline. Defaults to "#".
|
47 |
-
|
48 |
Returns:
|
49 |
str: Markdown table.
|
50 |
-
|
51 |
Raises:
|
52 |
ValueError: If the table could not be found.
|
53 |
"""
|
@@ -92,14 +87,11 @@ def remove_markdown_links(text: str) -> str:
|
|
92 |
def filter_dataframe_by_row_and_columns(df: pd.DataFrame, ignore_columns: list[str] | None = None) -> pd.DataFrame:
|
93 |
"""
|
94 |
Filter dataframe by the rows and columns to display.
|
95 |
-
|
96 |
This does not select based on the values in the dataframe, but rather on the index and columns.
|
97 |
Modified from https://blog.streamlit.io/auto-generate-a-dataframe-filtering-ui-in-streamlit-with-filter_dataframe/
|
98 |
-
|
99 |
Args:
|
100 |
df (pd.DataFrame): Original dataframe
|
101 |
ignore_columns (list[str], optional): Columns to ignore. Defaults to None.
|
102 |
-
|
103 |
Returns:
|
104 |
pd.DataFrame: Filtered dataframe
|
105 |
"""
|
@@ -127,12 +119,9 @@ def filter_dataframe_by_row_and_columns(df: pd.DataFrame, ignore_columns: list[s
|
|
127 |
def filter_dataframe_by_column_values(df: pd.DataFrame) -> pd.DataFrame:
|
128 |
"""
|
129 |
Filter dataframe by the values in the dataframe.
|
130 |
-
|
131 |
Modified from https://blog.streamlit.io/auto-generate-a-dataframe-filtering-ui-in-streamlit-with-filter_dataframe/
|
132 |
-
|
133 |
Args:
|
134 |
df (pd.DataFrame): Original dataframe
|
135 |
-
|
136 |
Returns:
|
137 |
pd.DataFrame: Filtered dataframe
|
138 |
"""
|
@@ -190,7 +179,7 @@ def filter_dataframe_by_column_values(df: pd.DataFrame) -> pd.DataFrame:
|
|
190 |
|
191 |
|
192 |
def setup_basic():
|
193 |
-
title = "π
|
194 |
|
195 |
st.set_page_config(
|
196 |
page_title=title,
|
@@ -200,9 +189,9 @@ def setup_basic():
|
|
200 |
st.title(title)
|
201 |
|
202 |
st.markdown(
|
203 |
-
"A joint community effort to create
|
204 |
f" Visit [swahili-llm-leaderboard]({GITHUB_URL}) to contribute. \n"
|
205 |
-
|
206 |
)
|
207 |
|
208 |
|
@@ -275,23 +264,9 @@ def setup_sources():
|
|
275 |
- [lmsys.org - Chatbot Arena benchmarks](https://lmsys.org/blog/2023-05-03-arena/)
|
276 |
- [Papers With Code](https://paperswithcode.com/)
|
277 |
- [Stanford HELM](https://crfm.stanford.edu/helm/latest/)
|
278 |
-
- [Stanford HELM](https://crfm.stanford.edu/helm/latest/)
|
279 |
- [HF Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
280 |
"""
|
281 |
)
|
282 |
-
def setup_Sponsorship():
|
283 |
-
st.markdown("## Sponsorship")
|
284 |
-
st.markdown(
|
285 |
-
# "The results of this leaderboard are collected from the individual papers and published results of the model "
|
286 |
-
# "authors. If you are interested in the sources of each individual reported model value, please visit the "
|
287 |
-
# f"[llm-leaderboard]({GITHUB_URL}) repository."
|
288 |
-
"The benchmark is English-based, and we need support translating it into Swahili."
|
289 |
-
"We welcome sponsorships to help advance this endeavor."
|
290 |
-
"Your sponsorship would facilitate this essential translation effort, bridging language barriers and making the benchmark "
|
291 |
-
"accessible to a broader audience. We're grateful for the dedication shown by our collaborators and aim to extend this impact "
|
292 |
-
"further with the support of sponsors committed to advancing language technologies."
|
293 |
-
"Any support please reach me: msamwelmollel@gmail.com"
|
294 |
-
)
|
295 |
|
296 |
def setup_Contribution():
|
297 |
st.markdown("## How to Contribute")
|
@@ -306,8 +281,21 @@ def setup_Contribution():
|
|
306 |
- Requesting and implementing new features
|
307 |
"""
|
308 |
st.markdown(markdown_content)
|
309 |
-
|
310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
|
312 |
def setup_disclaimer():
|
313 |
st.markdown("## Disclaimer")
|
@@ -326,12 +314,12 @@ def setup_footer():
|
|
326 |
)
|
327 |
|
328 |
|
329 |
-
|
330 |
def main():
|
331 |
setup_basic()
|
332 |
|
333 |
with open("README.md", "r") as f:
|
334 |
readme = f.read()
|
|
|
335 |
|
336 |
setup_leaderboard(readme)
|
337 |
# setup_benchmarks(readme)
|
|
|
12 |
|
13 |
def extract_table_and_format_from_markdown_text(markdown_table: str) -> pd.DataFrame:
|
14 |
"""Extracts a table from a markdown text and formats it as a pandas DataFrame.
|
|
|
15 |
Args:
|
16 |
text (str): Markdown text containing a table.
|
|
|
17 |
Returns:
|
18 |
pd.DataFrame: Table as pandas DataFrame.
|
19 |
"""
|
|
|
37 |
|
38 |
def extract_markdown_table_from_multiline(multiline: str, table_headline: str, next_headline_start: str = "#") -> str:
|
39 |
"""Extracts the markdown table from a multiline string.
|
|
|
40 |
Args:
|
41 |
multiline (str): content of README.md file.
|
42 |
table_headline (str): Headline of the table in the README.md file.
|
43 |
next_headline_start (str, optional): Start of the next headline. Defaults to "#".
|
|
|
44 |
Returns:
|
45 |
str: Markdown table.
|
|
|
46 |
Raises:
|
47 |
ValueError: If the table could not be found.
|
48 |
"""
|
|
|
87 |
def filter_dataframe_by_row_and_columns(df: pd.DataFrame, ignore_columns: list[str] | None = None) -> pd.DataFrame:
|
88 |
"""
|
89 |
Filter dataframe by the rows and columns to display.
|
|
|
90 |
This does not select based on the values in the dataframe, but rather on the index and columns.
|
91 |
Modified from https://blog.streamlit.io/auto-generate-a-dataframe-filtering-ui-in-streamlit-with-filter_dataframe/
|
|
|
92 |
Args:
|
93 |
df (pd.DataFrame): Original dataframe
|
94 |
ignore_columns (list[str], optional): Columns to ignore. Defaults to None.
|
|
|
95 |
Returns:
|
96 |
pd.DataFrame: Filtered dataframe
|
97 |
"""
|
|
|
119 |
def filter_dataframe_by_column_values(df: pd.DataFrame) -> pd.DataFrame:
|
120 |
"""
|
121 |
Filter dataframe by the values in the dataframe.
|
|
|
122 |
Modified from https://blog.streamlit.io/auto-generate-a-dataframe-filtering-ui-in-streamlit-with-filter_dataframe/
|
|
|
123 |
Args:
|
124 |
df (pd.DataFrame): Original dataframe
|
|
|
125 |
Returns:
|
126 |
pd.DataFrame: Filtered dataframe
|
127 |
"""
|
|
|
179 |
|
180 |
|
181 |
def setup_basic():
|
182 |
+
title = "π LLM-Leaderboard"
|
183 |
|
184 |
st.set_page_config(
|
185 |
page_title=title,
|
|
|
189 |
st.title(title)
|
190 |
|
191 |
st.markdown(
|
192 |
+
"A joint community effort to create one central leaderboard for LLMs."
|
193 |
f" Visit [swahili-llm-leaderboard]({GITHUB_URL}) to contribute. \n"
|
194 |
+
'We refer to a model being "open" if it can be locally deployed and used for commercial purposes.'
|
195 |
)
|
196 |
|
197 |
|
|
|
264 |
- [lmsys.org - Chatbot Arena benchmarks](https://lmsys.org/blog/2023-05-03-arena/)
|
265 |
- [Papers With Code](https://paperswithcode.com/)
|
266 |
- [Stanford HELM](https://crfm.stanford.edu/helm/latest/)
|
|
|
267 |
- [HF Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
|
268 |
"""
|
269 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
def setup_Contribution():
|
272 |
st.markdown("## How to Contribute")
|
|
|
281 |
- Requesting and implementing new features
|
282 |
"""
|
283 |
st.markdown(markdown_content)
|
|
|
284 |
|
285 |
+
def setup_Sponsorship():
|
286 |
+
st.markdown("## Sponsorship")
|
287 |
+
st.markdown(
|
288 |
+
# "The results of this leaderboard are collected from the individual papers and published results of the model "
|
289 |
+
# "authors. If you are interested in the sources of each individual reported model value, please visit the "
|
290 |
+
# f"[llm-leaderboard]({GITHUB_URL}) repository."
|
291 |
+
"The benchmark is English-based, and we need support translating it into Swahili."
|
292 |
+
"We welcome sponsorships to help advance this endeavor."
|
293 |
+
"Your sponsorship would facilitate this essential translation effort, bridging language barriers and making the benchmark "
|
294 |
+
"accessible to a broader audience. We're grateful for the dedication shown by our collaborators and aim to extend this impact "
|
295 |
+
"further with the support of sponsors committed to advancing language technologies."
|
296 |
+
"Any support please reach me: msamwelmollel@gmail.com"
|
297 |
+
)
|
298 |
+
|
299 |
|
300 |
def setup_disclaimer():
|
301 |
st.markdown("## Disclaimer")
|
|
|
314 |
)
|
315 |
|
316 |
|
|
|
317 |
def main():
|
318 |
setup_basic()
|
319 |
|
320 |
with open("README.md", "r") as f:
|
321 |
readme = f.read()
|
322 |
+
|
323 |
|
324 |
setup_leaderboard(readme)
|
325 |
# setup_benchmarks(readme)
|