benchmark_overview / old_app.py
UlrickBL's picture
Rename app.py to old_app.py
429e7a2 verified
raw
history blame
1.67 kB
import streamlit as st
import pandas as pd
from huggingface_hub import Repository
from st_aggrid import AgGrid, GridOptionsBuilder
st.set_page_config(layout="wide")
# Title and description
st.title("Benchmark Overview")
st.write("This application displays an overview of various benchmarks, their details, and related information in a clean and readable format.")
# Simulated CSV data (replace this with actual CSV reading if available)
df = pd.read_csv("benchmark_overview_data.csv")
# Display DataFrame in a nicely formatted table using AgGrid
st.write("### Benchmark Details Table")
# Add a selectbox for filtering by evaluated task or showing all
task_options = ["All"] + list(df["Evaluated task"].unique())
selected_task = st.selectbox("Select an Evaluated Task", options=task_options)
# Filter data if a specific task is selected
if selected_task != "All":
filtered_data = df[df["Evaluated task"] == selected_task]
else:
filtered_data = df
# Configure AgGrid options
builder = GridOptionsBuilder.from_dataframe(filtered_data)
builder.configure_default_column(resizable=True, wrapText=True, autoHeight=False) # Disable autoHeight
builder.configure_grid_options(domLayout='normal', rowHeight=40) # Set fixed row height
# Make the Benchmark column bold
builder.configure_columns(["Benchmark"], cellStyle={"fontWeight": "bold"})
# Enable tooltips for viewing full cell content
builder.configure_columns(filtered_data.columns.tolist(), tooltipField="value")
options = builder.build()
AgGrid(filtered_data, gridOptions=options, height=600, fit_columns_on_grid_load=True, theme="streamlit", allow_unsafe_jscode=True) # Display filtered or full data