GUI: abgebrochenen oder teils ausgefallenen Batch fortsetzen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -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">
|
||||
|
||||
@ -108,8 +108,8 @@ export const api = {
|
||||
discoverModels: (adapter: string, url: string, apiKeyEnv: string) =>
|
||||
invoke<string[]>("discover_models", { adapter, url, apiKeyEnv }),
|
||||
testModel: (name: string) => invoke<ModelTest>("test_model", { name }),
|
||||
startBatch: (models: string[], taskIds: string[], repeats: number, note: string) =>
|
||||
invoke<BatchSummary>("start_batch", { models, taskIds, repeats, note }),
|
||||
startBatch: (models: string[], taskIds: string[], repeats: number, note: string, batchId: number | null = null) =>
|
||||
invoke<BatchSummary>("start_batch", { models, taskIds, repeats, note, batchId }),
|
||||
cancelBatch: () => invoke<boolean>("cancel_batch"),
|
||||
batches: () => invoke<BatchInfo[]>("list_batches"),
|
||||
results: (batchId: number) => invoke<RunRow[]>("batch_results", { batchId }),
|
||||
|
||||
Reference in New Issue
Block a user