diff --git a/src/guidellm/benchmark/outputs/html.py b/src/guidellm/benchmark/outputs/html.py index 34cf71073..ea8aaa8b7 100644 --- a/src/guidellm/benchmark/outputs/html.py +++ b/src/guidellm/benchmark/outputs/html.py @@ -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 @@ -282,8 +283,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"}, diff --git a/src/ui/lib/components/PageHeader/PageHeader.component.tsx b/src/ui/lib/components/PageHeader/PageHeader.component.tsx index 683cf837d..f2e0170d7 100644 --- a/src/ui/lib/components/PageHeader/PageHeader.component.tsx +++ b/src/ui/lib/components/PageHeader/PageHeader.component.tsx @@ -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 ( @@ -24,11 +26,16 @@ export const Component = () => { variant="metric2" withTooltip /> +