mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-29 10:41:28 +00:00
Adjust defaults for ui graph to get and show all losses
This commit is contained in:
@@ -79,7 +79,7 @@ export default function JobLossGraph({ job }: Props) {
|
|||||||
const [plotStride, setPlotStride] = useState(1);
|
const [plotStride, setPlotStride] = useState(1);
|
||||||
|
|
||||||
// show only last N points in the chart (0 = all)
|
// show only last N points in the chart (0 = all)
|
||||||
const [windowSize, setWindowSize] = useState<number>(4000);
|
const [windowSize, setWindowSize] = useState<number>(0);
|
||||||
|
|
||||||
// quick y clipping for readability
|
// quick y clipping for readability
|
||||||
const [clipOutliers, setClipOutliers] = useState(false);
|
const [clipOutliers, setClipOutliers] = useState(false);
|
||||||
@@ -187,25 +187,6 @@ export default function JobLossGraph({ job }: Props) {
|
|||||||
return [lo, hi];
|
return [lo, hi];
|
||||||
}, [clipOutliers, chartData, activeKeys, showSmoothed]);
|
}, [clipOutliers, chartData, activeKeys, showSmoothed]);
|
||||||
|
|
||||||
const latestSummary = useMemo(() => {
|
|
||||||
// Provide a simple “latest” readout for the first active series
|
|
||||||
const firstKey = activeKeys[0];
|
|
||||||
if (!firstKey) return null;
|
|
||||||
|
|
||||||
const s = perSeries[firstKey];
|
|
||||||
if (!s) return null;
|
|
||||||
|
|
||||||
const lastRaw = s.raw.length ? s.raw[s.raw.length - 1] : null;
|
|
||||||
const lastSmooth = s.smooth.length ? s.smooth[s.smooth.length - 1] : null;
|
|
||||||
|
|
||||||
return {
|
|
||||||
key: firstKey,
|
|
||||||
step: lastRaw?.step ?? lastSmooth?.step ?? null,
|
|
||||||
raw: lastRaw?.value ?? null,
|
|
||||||
smooth: lastSmooth?.value ?? null,
|
|
||||||
};
|
|
||||||
}, [activeKeys, perSeries]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-gray-900 rounded-xl shadow-lg overflow-hidden border border-gray-800 flex flex-col">
|
<div className="bg-gray-900 rounded-xl shadow-lg overflow-hidden border border-gray-800 flex flex-col">
|
||||||
<div className="bg-gray-800 px-4 py-3 flex items-center justify-between">
|
<div className="bg-gray-800 px-4 py-3 flex items-center justify-between">
|
||||||
|
|||||||
@@ -64,8 +64,7 @@ export default function useJobLossLog(jobID: string, reloadInterval: null | numb
|
|||||||
params.since_step = lastStepByKeyRef.current[k];
|
params.since_step = lastStepByKeyRef.current[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
// keep default limit from server (or set explicitly if you want)
|
params.limit = 1000000;
|
||||||
// params.limit = 2000;
|
|
||||||
|
|
||||||
return apiClient
|
return apiClient
|
||||||
.get(`/api/jobs/${jobID}/loss`, { params })
|
.get(`/api/jobs/${jobID}/loss`, { params })
|
||||||
|
|||||||
Reference in New Issue
Block a user