Skip to content

Commit e23b2c6

Browse files
authored
fix(dashboard): keep numeric dtype so columns sort numerically (#46)
The summary table coerced metrics to formatted strings via f'{x:.2f}', which made the Gradio DataFrame sort them lexicographically (114.42, 1785.64, 181.58 …). Use pd.to_numeric(...).round(2) instead so the underlying dtype stays numeric and sorting behaves as expected. Fixes #24
1 parent ec6b67a commit e23b2c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extra/dashboard/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def summary_table() -> pd.DataFrame:
7777
'token_throughput_secs']]
7878
for metric in ['inter_token_latency_ms_p90', 'time_to_first_token_ms_p90', 'e2e_latency_ms_p90',
7979
'token_throughput_secs']:
80-
data[metric] = data[metric].apply(lambda x: f"{x:.2f}")
80+
data[metric] = pd.to_numeric(data[metric], errors='coerce').round(2)
8181
data = data.rename(
8282
columns=column_mappings)
8383
return data

0 commit comments

Comments
 (0)