File size: 1,671 Bytes
8fc14a2
 
7e92174
04f0854
 
 
7e92174
8fc14a2
 
 
 
 
f6a6fe3
8fc14a2
04f0854
8fc14a2
04f0854
3b279ba
 
 
 
 
 
 
 
 
 
04f0854
3b279ba
f200cca
 
ec0731e
 
b28996e
ec0731e
b28996e
 
04f0854
 
b28996e
 
ec0731e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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