GUI: abgebrochenen oder teils ausgefallenen Batch fortsetzen

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 19:25:25 +01:00
parent 52b13bd269
commit e322a14030
3 changed files with 16 additions and 7 deletions

View File

@ -160,7 +160,7 @@
return (tasks?.tasks ?? []).filter((t) => chosenTasks.includes(t.id));
}
async function start() {
async function start(resumeBatch: number | null = null) {
error = "";
log = [];
progress = null;
@ -170,7 +170,7 @@
for (const m of chosenModels) for (const t of chosenTaskInfos()) cells[key(m, t.id)] = { state: "planned", n: 0, sum: 0, cls: "" };
running = true;
try {
const s = await api.startBatch($state.snapshot(chosenModels), $state.snapshot(chosenTasks), repeats, "");
const s = await api.startBatch($state.snapshot(chosenModels), $state.snapshot(chosenTasks), repeats, "", resumeBatch);
finishedBatch = s.batch_id;
cancelled = s.cancelled;
} catch (e) {
@ -182,6 +182,10 @@
}
}
// Offen ist, was nicht fertig gewertet wurde: abgebrochen oder durch einen Ausfall nicht gewertet.
let openCells = $derived(Object.values(cells).filter((c) => c.state !== "done" && c.state !== "skipped").length);
let canResume = $derived(!running && finishedBatch !== null && openCells > 0);
function cellOf(model: string, task: string): Cell | undefined {
return cells[key(model, task)];
}
@ -347,8 +351,11 @@
{#if error}<p class="error">{error}</p>{/if}
{#if finishedBatch !== null}
<p>
{cancelled ? "Abgebrochen." : "Fertig."}
{cancelled ? "Abgebrochen." : openCells > 0 ? `Fertig, aber ${openCells} Zelle(n) offen oder nicht gewertet.` : "Fertig."}
<button class="link" onclick={() => onfinished(finishedBatch!)}>Ergebnisse ansehen</button>
{#if canResume}
· <button class="link" onclick={() => start(finishedBatch)}>Fortsetzen</button>
{/if}
</p>
{/if}
{#if log.length > 0}
@ -384,7 +391,7 @@
Durchläufe
<input type="number" min="1" max="20" bind:value={repeats} disabled={running} />
</label>
<button class="primary" onclick={start} disabled={!canStart}>Benchmark starten</button>
<button class="primary" onclick={() => start()} disabled={!canStart}>Benchmark starten</button>
<button class="danger" onclick={() => api.cancelBatch()} disabled={!running}>Abbrechen</button>
{#if progress}
<div class="progress">