felix
update
2eed92b
raw
history blame
2.19 kB
# app.py
import streamlit as st
import glob
import os
from datetime import datetime
#st.set_page_config(layout="wide")
st.title('Meta Open LLM leaderboard')
data_path = './data/20230820_0354/'
# Extracting date and time information from the path
date_str = data_path.split('/')[-2]
parsed_date = datetime.strptime(date_str, "%Y%m%d_%H%M")
# Formatting the parsed date
formatted_date = parsed_date.strftime("%b %d, %Y %H:%M")
captions_map = {
"hg_average_to_agentbench_compare.png": "HF to AgentBench compare",
"hg_average_to_opencompass_compare.png": "HF to OpenCompass compare",
"hg_average_to_mt_bench_compare.png": "HF to MT-Bench compare",
"hg_average_to_mosaic_compare.png": "HF to MosaicML compare",
"hg_average_to_alpacaeval_compare.png": "HF to AlpacaEval compare"
}
st.write("Generated on: <b>" + formatted_date + "</b>", unsafe_allow_html=True)
st.divider()
imgs = glob.glob(os.path.join(data_path, '*.png'))
# Extracting images that start with "hf_llm_diagram"
hf_llm_diagrams = [img for img in imgs if 'hf_llm_diagram' in os.path.basename(img)]
# Getting the remaining images
remaining_imgs = [img for img in imgs if 'hf_llm_diagram' not in os.path.basename(img)]
st.write("HuggingFace Open LLM leaderboard by Model Size")
st.image(hf_llm_diagrams,use_column_width="auto")
st.divider()
st.write("HuggingFace and Other Leaderboards: A Comparative Model Evaluation")
st.caption("Only models evaluated on both leaderboards are included.")
cols = st.columns(2)
for i, img in enumerate(remaining_imgs):
# Extract the filename from the full image path
filename = os.path.basename(img)
# Get the caption from the captions_map dictionary
caption = captions_map.get(filename, "") # If no caption is found, it will default to an empty string
# Display the image with the caption
cols[i % 2].image(img, caption=caption, width=None)
st.divider()
st.subheader('About')
st.write('This meta leaderboard is built and maintained by Felix Zaslavskiy. For feedback, correction, suggestions please reach out on X at <a href="https://twitter.com/FZaslavskiy" >@FZaslavskiy</a> or here via community discussions.', unsafe_allow_html=True)