Skip to content
10 changes: 9 additions & 1 deletion src/guidellm/benchmark/outputs/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pathlib import Path
from typing import Any, ClassVar

import httpx
from loguru import logger
from pydantic import BaseModel, Field, computed_field

Expand Down Expand Up @@ -333,8 +334,15 @@ def _build_run_info(
"""
model = args.model or "N/A"
timestamp = max(bm.start_time for bm in benchmarks if bm.start_time is not None)
model_size = 0
try:
response = httpx.get(f"https://huggingface.co/api/models/{model}")
model_size = response.json().get("usedStorage", 0)
except (httpx.HTTPError, ValueError):
logger.warning("Could not find huggingface model with model size")

return {
"model": {"name": model, "size": 0},
"model": {"name": model, "size": model_size},
"task": "N/A",
"timestamp": timestamp,
"dataset": {"name": "N/A"},
Expand Down
11 changes: 9 additions & 2 deletions src/ui/lib/components/PageHeader/PageHeader.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
import { Box, Typography } from '@mui/material';

import { useGetRunInfoQuery } from '../../store/slices/runInfo';
import { formateDate } from '../../utils/helpers';
import { formateDate, getFileSize } from '../../utils/helpers';
import { SpecBadge } from '../SpecBadge';
import { HeaderCell, HeaderWrapper } from './PageHeader.styles';

export const Component = () => {
const { data } = useGetRunInfoQuery();
const modelSize = getFileSize(data?.model?.size || 0);

return (
<Box py={2}>
<Typography variant="subtitle2" color="surface.onSurfaceAccent">
Expand All @@ -24,11 +26,16 @@ export const Component = () => {
variant="metric2"
withTooltip
/>
<SpecBadge
label="Model size"
value={data?.model?.size ? `${modelSize?.size} ${modelSize?.units}` : '0B'}
variant="body1"
/>
</HeaderCell>
<HeaderCell item xs={2} sx={{ paddingRight: 0 }}>
<SpecBadge
label="Time Stamp"
value={data?.timestamp ? formateDate(data?.timestamp) : 'n/a'}
value={data?.timestamp ? formateDate(data?.timestamp) : 'N/A'}
variant="caption"
/>
</HeaderCell>
Expand Down