Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,69 +5,83 @@ import pandas as pd
|
|
5 |
df_benchmark = pd.read_csv('leaderboard_data.csv')
|
6 |
df_server = pd.read_csv('server_specs.csv')
|
7 |
|
8 |
-
#
|
9 |
-
|
10 |
-
|
11 |
|
12 |
-
#
|
13 |
-
|
|
|
14 |
|
15 |
-
#
|
16 |
-
|
17 |
-
st.
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
21 |
|
22 |
-
#
|
23 |
-
|
24 |
-
st.header("Filters")
|
25 |
-
model_options = st.multiselect("Select model:", options=sorted(df["Model"].dropna().unique()))
|
26 |
-
gpu_options = st.multiselect("Select GPU:", options=sorted(df["GPUs"].dropna().unique()))
|
27 |
-
quantization_options = st.multiselect("Quantization:", options=sorted(df["Quantization"].dropna().unique()))
|
28 |
-
context_length_options = st.multiselect("Context length:", options=sorted(df["Context Length"].dropna().unique()))
|
29 |
-
start_type_options = st.multiselect("Start type:", options=sorted(df["Start Type"].dropna().unique()))
|
30 |
-
power_options = st.multiselect("Max GPU power (W):", options=sorted(df["GPU Max Power (W)"].dropna().unique()))
|
31 |
-
server_options = st.multiselect("Select server:", options=sorted(df["Server Name"].dropna().unique()))
|
32 |
|
33 |
-
#
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
if quantization_options:
|
40 |
-
filtered_df = filtered_df[filtered_df["Quantization"].isin(quantization_options)]
|
41 |
-
if context_length_options:
|
42 |
-
filtered_df = filtered_df[filtered_df["Context Length"].isin(context_length_options)]
|
43 |
-
if start_type_options:
|
44 |
-
filtered_df = filtered_df[filtered_df["Start Type"].isin(start_type_options)]
|
45 |
-
if power_options:
|
46 |
-
filtered_df = filtered_df[filtered_df["GPU Max Power (W)"].isin(power_options)]
|
47 |
-
if server_options:
|
48 |
-
filtered_df = filtered_df[filtered_df["Server Name"].isin(server_options)]
|
49 |
|
50 |
-
#
|
51 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
-
#
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
-
#
|
58 |
-
|
59 |
-
selected_index = st.number_input(
|
60 |
-
"Enter the row number to view server specifications:",
|
61 |
-
min_value=0,
|
62 |
-
max_value=len(filtered_df) - 1,
|
63 |
-
value=0,
|
64 |
-
step=1
|
65 |
-
)
|
66 |
-
selected_server = filtered_df.iloc[selected_index]["Server Name"]
|
67 |
-
server_specs_row = df_server_filtered[df_server_filtered["Server Name"] == selected_server]
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
df_benchmark = pd.read_csv('leaderboard_data.csv')
|
6 |
df_server = pd.read_csv('server_specs.csv')
|
7 |
|
8 |
+
# Normalize column names (remove extra spaces, make case consistent)
|
9 |
+
df_benchmark.columns = df_benchmark.columns.str.strip()
|
10 |
+
df_server.columns = df_server.columns.str.strip()
|
11 |
|
12 |
+
# Debug output (optional)
|
13 |
+
# st.write("Benchmark columns:", df_benchmark.columns.tolist())
|
14 |
+
# st.write("Server columns:", df_server.columns.tolist())
|
15 |
|
16 |
+
# Ensure "Server Name" exists in both
|
17 |
+
if "Server Name" not in df_benchmark.columns:
|
18 |
+
st.error('"Server Name" column not found in leaderboard_data.csv')
|
19 |
+
elif "Server Name" not in df_server.columns:
|
20 |
+
st.error('"Server Name" column not found in server_specs.csv')
|
21 |
+
else:
|
22 |
+
# Remove duplicated columns except "Server Name"
|
23 |
+
duplicate_cols = set(df_benchmark.columns) & set(df_server.columns) - {"Server Name"}
|
24 |
+
df_server_filtered = df_server.drop(columns=duplicate_cols)
|
25 |
|
26 |
+
# Merge datasets
|
27 |
+
df = pd.merge(df_benchmark, df_server_filtered, on="Server Name", how="left")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
+
# Continue with the rest of the app...
|
30 |
+
st.title("MSNP Leaderboard")
|
31 |
+
st.markdown("""
|
32 |
+
[GitHub Repository](https://github.com/EvilFreelancer/llm-msnp-tests)
|
33 |
+
This leaderboard shows the performance of quantized GGUF models (via Ollama) on various CPU and GPU combinations in a single-node setup.
|
34 |
+
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
+
# Filters
|
37 |
+
with st.sidebar:
|
38 |
+
st.header("Filters")
|
39 |
+
model_options = st.multiselect("Select model:", options=sorted(df["Model"].dropna().unique()))
|
40 |
+
gpu_options = st.multiselect("Select GPU:", options=sorted(df["GPUs"].dropna().unique()))
|
41 |
+
quantization_options = st.multiselect("Quantization:", options=sorted(df["Quantization"].dropna().unique()))
|
42 |
+
context_length_options = st.multiselect("Context length:", options=sorted(df["Context Length"].dropna().unique()))
|
43 |
+
start_type_options = st.multiselect("Start type:", options=sorted(df["Start Type"].dropna().unique()))
|
44 |
+
power_options = st.multiselect("Max GPU power (W):", options=sorted(df["GPU Max Power (W)"].dropna().unique()))
|
45 |
+
server_options = st.multiselect("Select server:", options=sorted(df["Server Name"].dropna().unique()))
|
46 |
|
47 |
+
# Apply filters
|
48 |
+
filtered_df = df.copy()
|
49 |
+
if model_options:
|
50 |
+
filtered_df = filtered_df[filtered_df["Model"].isin(model_options)]
|
51 |
+
if gpu_options:
|
52 |
+
filtered_df = filtered_df[filtered_df["GPUs"].isin(gpu_options)]
|
53 |
+
if quantization_options:
|
54 |
+
filtered_df = filtered_df[filtered_df["Quantization"].isin(quantization_options)]
|
55 |
+
if context_length_options:
|
56 |
+
filtered_df = filtered_df[filtered_df["Context Length"].isin(context_length_options)]
|
57 |
+
if start_type_options:
|
58 |
+
filtered_df = filtered_df[filtered_df["Start Type"].isin(start_type_options)]
|
59 |
+
if power_options:
|
60 |
+
filtered_df = filtered_df[filtered_df["GPU Max Power (W)"].isin(power_options)]
|
61 |
+
if server_options:
|
62 |
+
filtered_df = filtered_df[filtered_df["Server Name"].isin(server_options)]
|
63 |
|
64 |
+
# Display filtered table
|
65 |
+
st.dataframe(filtered_df.sort_values(by="Tokens/sec", ascending=False).reset_index(drop=True))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
+
# Notes
|
68 |
+
st.markdown("## Notes")
|
69 |
+
st.markdown("Click links in the 'Test Link' column for more details.")
|
70 |
+
|
71 |
+
# Server specs
|
72 |
+
if st.checkbox("Show server specifications"):
|
73 |
+
selected_index = st.number_input(
|
74 |
+
"Enter the row number to view server specifications:",
|
75 |
+
min_value=0,
|
76 |
+
max_value=len(filtered_df) - 1,
|
77 |
+
value=0,
|
78 |
+
step=1
|
79 |
+
)
|
80 |
+
selected_server = filtered_df.iloc[selected_index]["Server Name"]
|
81 |
+
server_specs_row = df_server_filtered[df_server_filtered["Server Name"] == selected_server]
|
82 |
+
|
83 |
+
if not server_specs_row.empty:
|
84 |
+
st.subheader(f"Server specifications: {selected_server}")
|
85 |
+
st.table(server_specs_row.drop(columns=["Server Name"]).transpose())
|
86 |
+
else:
|
87 |
+
st.write("Specifications for the selected server are not available.")
|