inspect-ai 0.3.56__py3-none-any.whl → 0.3.58__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inspect_ai/__init__.py +2 -1
- inspect_ai/_cli/common.py +4 -2
- inspect_ai/_cli/eval.py +2 -0
- inspect_ai/_cli/trace.py +21 -2
- inspect_ai/_display/core/active.py +0 -2
- inspect_ai/_display/core/panel.py +1 -1
- inspect_ai/_display/rich/display.py +4 -4
- inspect_ai/_display/textual/app.py +4 -1
- inspect_ai/_display/textual/widgets/samples.py +41 -5
- inspect_ai/_eval/eval.py +32 -20
- inspect_ai/_eval/evalset.py +7 -5
- inspect_ai/_eval/run.py +16 -11
- inspect_ai/_eval/task/__init__.py +2 -2
- inspect_ai/_eval/task/images.py +40 -25
- inspect_ai/_eval/task/run.py +141 -119
- inspect_ai/_eval/task/task.py +140 -25
- inspect_ai/_util/constants.py +1 -0
- inspect_ai/_util/content.py +23 -1
- inspect_ai/_util/datetime.py +1 -1
- inspect_ai/_util/deprecation.py +1 -1
- inspect_ai/_util/images.py +20 -17
- inspect_ai/_util/json.py +11 -1
- inspect_ai/_util/kvstore.py +73 -0
- inspect_ai/_util/logger.py +2 -1
- inspect_ai/_util/notgiven.py +18 -0
- inspect_ai/_util/thread.py +5 -0
- inspect_ai/_util/trace.py +39 -3
- inspect_ai/_util/transcript.py +36 -7
- inspect_ai/_view/www/.prettierrc.js +12 -0
- inspect_ai/_view/www/dist/assets/index.js +322 -226
- inspect_ai/_view/www/log-schema.json +221 -138
- inspect_ai/_view/www/src/App.mjs +18 -9
- inspect_ai/_view/www/src/Types.mjs +0 -1
- inspect_ai/_view/www/src/api/Types.mjs +15 -4
- inspect_ai/_view/www/src/api/api-http.mjs +2 -0
- inspect_ai/_view/www/src/components/ExpandablePanel.mjs +2 -2
- inspect_ai/_view/www/src/components/FindBand.mjs +5 -4
- inspect_ai/_view/www/src/components/LargeModal.mjs +1 -1
- inspect_ai/_view/www/src/components/MessageBand.mjs +2 -2
- inspect_ai/_view/www/src/components/MessageContent.mjs +44 -2
- inspect_ai/_view/www/src/components/TabSet.mjs +1 -1
- inspect_ai/_view/www/src/components/Tools.mjs +18 -3
- inspect_ai/_view/www/src/components/VirtualList.mjs +15 -17
- inspect_ai/_view/www/src/log/remoteLogFile.mjs +2 -1
- inspect_ai/_view/www/src/navbar/Navbar.mjs +44 -32
- inspect_ai/_view/www/src/samples/SampleDisplay.mjs +1 -2
- inspect_ai/_view/www/src/samples/SampleList.mjs +35 -4
- inspect_ai/_view/www/src/samples/SampleScoreView.mjs +13 -2
- inspect_ai/_view/www/src/samples/SampleScores.mjs +11 -2
- inspect_ai/_view/www/src/samples/SamplesDescriptor.mjs +242 -178
- inspect_ai/_view/www/src/samples/SamplesTab.mjs +4 -2
- inspect_ai/_view/www/src/samples/tools/SampleFilter.mjs +5 -5
- inspect_ai/_view/www/src/samples/tools/SelectScorer.mjs +7 -0
- inspect_ai/_view/www/src/samples/tools/SortFilter.mjs +3 -3
- inspect_ai/_view/www/src/samples/transcript/ToolEventView.mjs +1 -1
- inspect_ai/_view/www/src/types/log.d.ts +53 -35
- inspect_ai/_view/www/src/workspace/WorkSpace.mjs +1 -1
- inspect_ai/approval/_human/util.py +2 -2
- inspect_ai/dataset/_sources/csv.py +2 -1
- inspect_ai/dataset/_sources/json.py +2 -1
- inspect_ai/dataset/_sources/util.py +15 -7
- inspect_ai/log/_condense.py +11 -1
- inspect_ai/log/_log.py +27 -5
- inspect_ai/log/_recorders/eval.py +21 -8
- inspect_ai/log/_samples.py +10 -5
- inspect_ai/log/_transcript.py +28 -1
- inspect_ai/model/__init__.py +10 -2
- inspect_ai/model/_call_tools.py +82 -17
- inspect_ai/model/_chat_message.py +2 -4
- inspect_ai/model/{_trace.py → _conversation.py} +9 -8
- inspect_ai/model/_model.py +2 -2
- inspect_ai/model/_providers/anthropic.py +9 -7
- inspect_ai/model/_providers/azureai.py +6 -4
- inspect_ai/model/_providers/bedrock.py +6 -4
- inspect_ai/model/_providers/google.py +103 -14
- inspect_ai/model/_providers/groq.py +7 -5
- inspect_ai/model/_providers/hf.py +11 -6
- inspect_ai/model/_providers/mistral.py +6 -9
- inspect_ai/model/_providers/openai.py +34 -8
- inspect_ai/model/_providers/openai_o1.py +10 -12
- inspect_ai/model/_providers/vertex.py +17 -4
- inspect_ai/scorer/__init__.py +13 -2
- inspect_ai/scorer/_metrics/__init__.py +2 -2
- inspect_ai/scorer/_metrics/std.py +3 -3
- inspect_ai/tool/__init__.py +9 -1
- inspect_ai/tool/_tool.py +9 -2
- inspect_ai/tool/_tool_info.py +2 -1
- inspect_ai/tool/_tools/_web_browser/_resources/dm_env_servicer.py +9 -9
- inspect_ai/tool/_tools/_web_browser/_web_browser.py +3 -3
- inspect_ai/util/__init__.py +4 -3
- inspect_ai/util/{_trace.py → _conversation.py} +3 -17
- inspect_ai/util/_display.py +14 -4
- inspect_ai/util/_sandbox/context.py +12 -13
- inspect_ai/util/_sandbox/docker/compose.py +24 -13
- inspect_ai/util/_sandbox/docker/docker.py +20 -13
- inspect_ai/util/_sandbox/docker/util.py +2 -1
- inspect_ai/util/_sandbox/environment.py +13 -1
- inspect_ai/util/_sandbox/local.py +1 -0
- inspect_ai/util/_sandbox/self_check.py +18 -18
- inspect_ai/util/_store.py +2 -2
- inspect_ai/util/_subprocess.py +3 -3
- {inspect_ai-0.3.56.dist-info → inspect_ai-0.3.58.dist-info}/METADATA +3 -3
- {inspect_ai-0.3.56.dist-info → inspect_ai-0.3.58.dist-info}/RECORD +107 -103
- {inspect_ai-0.3.56.dist-info → inspect_ai-0.3.58.dist-info}/WHEEL +1 -1
- {inspect_ai-0.3.56.dist-info → inspect_ai-0.3.58.dist-info}/LICENSE +0 -0
- {inspect_ai-0.3.56.dist-info → inspect_ai-0.3.58.dist-info}/entry_points.txt +0 -0
- {inspect_ai-0.3.56.dist-info → inspect_ai-0.3.58.dist-info}/top_level.txt +0 -0
@@ -8499,7 +8499,10 @@ var require_assets = __commonJS({
|
|
8499
8499
|
children: children2
|
8500
8500
|
}) => {
|
8501
8501
|
const tabContentsId = computeTabContentsId(id, index);
|
8502
|
-
const tabContentsRef = A(
|
8502
|
+
const tabContentsRef = A(
|
8503
|
+
/** @type {HTMLElement|null} */
|
8504
|
+
null
|
8505
|
+
);
|
8503
8506
|
y(() => {
|
8504
8507
|
setTimeout(() => {
|
8505
8508
|
if (scrollPosition !== void 0 && tabContentsRef.current && tabContentsRef.current.scrollTop !== scrollPosition) {
|
@@ -15138,8 +15141,14 @@ var require_assets = __commonJS({
|
|
15138
15141
|
}) => {
|
15139
15142
|
const [collapsed, setCollapsed] = h(collapse);
|
15140
15143
|
const [showToggle, setShowToggle] = h(false);
|
15141
|
-
const contentsRef = A(
|
15142
|
-
|
15144
|
+
const contentsRef = A(
|
15145
|
+
/** @type {HTMLElement|null} */
|
15146
|
+
null
|
15147
|
+
);
|
15148
|
+
const observerRef = A(
|
15149
|
+
/** @type {IntersectionObserver|null} */
|
15150
|
+
null
|
15151
|
+
);
|
15143
15152
|
y(() => {
|
15144
15153
|
setCollapsed(collapse);
|
15145
15154
|
}, [children2, collapse]);
|
@@ -15259,7 +15268,16 @@ var require_assets = __commonJS({
|
|
15259
15268
|
mode
|
15260
15269
|
}) => {
|
15261
15270
|
function isContentImage(value) {
|
15262
|
-
|
15271
|
+
if (value && typeof value === "object") {
|
15272
|
+
if (value.type === "image") {
|
15273
|
+
return true;
|
15274
|
+
} else if (value.type === "tool") {
|
15275
|
+
if (Array.isArray(value.content) && value.content.some(isContentImage)) {
|
15276
|
+
return true;
|
15277
|
+
}
|
15278
|
+
}
|
15279
|
+
}
|
15280
|
+
return false;
|
15263
15281
|
}
|
15264
15282
|
const collapse = Array.isArray(output) ? output.every((item) => !isContentImage(item)) : !isContentImage(output);
|
15265
15283
|
return m$1`<div>
|
@@ -15313,7 +15331,7 @@ var require_assets = __commonJS({
|
|
15313
15331
|
}
|
15314
15332
|
if (view) {
|
15315
15333
|
const toolInputRef = A(
|
15316
|
-
/** @type {
|
15334
|
+
/** @type {import("preact").Component & { base: Element }} */
|
15317
15335
|
null
|
15318
15336
|
);
|
15319
15337
|
y(() => {
|
@@ -15389,7 +15407,7 @@ var require_assets = __commonJS({
|
|
15389
15407
|
m$1`<img
|
15390
15408
|
src="${out.image}"
|
15391
15409
|
style=${{
|
15392
|
-
maxWidth: "
|
15410
|
+
maxWidth: "800px",
|
15393
15411
|
border: "solid var(--bs-border-color) 1px",
|
15394
15412
|
...style2
|
15395
15413
|
}}
|
@@ -15520,7 +15538,7 @@ var require_assets = __commonJS({
|
|
15520
15538
|
return m$1`<img
|
15521
15539
|
src="${content.image}"
|
15522
15540
|
style=${{
|
15523
|
-
maxWidth: "
|
15541
|
+
maxWidth: "800px",
|
15524
15542
|
border: "solid var(--bs-border-color) 1px"
|
15525
15543
|
}}
|
15526
15544
|
/>`;
|
@@ -15529,12 +15547,46 @@ var require_assets = __commonJS({
|
|
15529
15547
|
}
|
15530
15548
|
}
|
15531
15549
|
},
|
15550
|
+
audio: {
|
15551
|
+
render: (content) => {
|
15552
|
+
return m$1` <audio controls>
|
15553
|
+
<source
|
15554
|
+
src=${content.audio}
|
15555
|
+
type=${mimeTypeForFormat(content.format)}
|
15556
|
+
/>
|
15557
|
+
</audio>`;
|
15558
|
+
}
|
15559
|
+
},
|
15560
|
+
video: {
|
15561
|
+
render: (content) => {
|
15562
|
+
return m$1` <video width="500" height="375" controls>
|
15563
|
+
<source
|
15564
|
+
src=${content.video}
|
15565
|
+
type=${mimeTypeForFormat(content.format)}
|
15566
|
+
/>
|
15567
|
+
</video>`;
|
15568
|
+
}
|
15569
|
+
},
|
15532
15570
|
tool: {
|
15533
15571
|
render: (content) => {
|
15534
15572
|
return m$1`<${ToolOutput} output=${content.content} />`;
|
15535
15573
|
}
|
15536
15574
|
}
|
15537
15575
|
};
|
15576
|
+
const mimeTypeForFormat = (format2) => {
|
15577
|
+
switch (format2) {
|
15578
|
+
case "mov":
|
15579
|
+
return "video/quicktime";
|
15580
|
+
case "wav":
|
15581
|
+
return "audio/wav";
|
15582
|
+
case "mp3":
|
15583
|
+
return "audio/mpeg";
|
15584
|
+
case "mp4":
|
15585
|
+
return "video/mp4";
|
15586
|
+
case "mpeg":
|
15587
|
+
return "video/mpeg";
|
15588
|
+
}
|
15589
|
+
};
|
15538
15590
|
const ChatView = ({
|
15539
15591
|
id,
|
15540
15592
|
messages,
|
@@ -16475,7 +16527,7 @@ ${entry.value}</pre
|
|
16475
16527
|
};
|
16476
16528
|
const MessageBand = ({ message, hidden, setHidden, type }) => {
|
16477
16529
|
const bgColor = type === "info" ? "var(--bs-light)" : "var(--bs-" + type + "-bg-subtle)";
|
16478
|
-
const color =
|
16530
|
+
const color = type === "info" ? void 0 : "var(--bs-" + type + "-text-emphasis)";
|
16479
16531
|
return m$1`
|
16480
16532
|
<div
|
16481
16533
|
style=${{
|
@@ -16498,7 +16550,7 @@ ${entry.value}</pre
|
|
16498
16550
|
fontSize: FontSize["title-secondary"],
|
16499
16551
|
margin: "0",
|
16500
16552
|
padding: "0",
|
16501
|
-
color
|
16553
|
+
color,
|
16502
16554
|
height: FontSize["title-secondary"],
|
16503
16555
|
lineHeight: FontSize["title-secondary"]
|
16504
16556
|
}}
|
@@ -16531,7 +16583,10 @@ ${entry.value}</pre
|
|
16531
16583
|
setWarningHidden
|
16532
16584
|
} = props;
|
16533
16585
|
const modalFooter = footer ? m$1`<div class="modal-footer">${footer}</div>` : "";
|
16534
|
-
const scrollRef = A(
|
16586
|
+
const scrollRef = A(
|
16587
|
+
/** @type {HTMLElement|null} */
|
16588
|
+
null
|
16589
|
+
);
|
16535
16590
|
y(() => {
|
16536
16591
|
if (scrollRef.current) {
|
16537
16592
|
setTimeout(() => {
|
@@ -16681,7 +16736,7 @@ ${entry.value}</pre
|
|
16681
16736
|
});
|
16682
16737
|
};
|
16683
16738
|
const SampleScores = ({ sample, sampleDescriptor, scorer }) => {
|
16684
|
-
const scores = scorer ? sampleDescriptor.
|
16739
|
+
const scores = scorer ? sampleDescriptor.evalDescriptor.scorerDescriptor(sample, { scorer, name: scorer }).scores() : sampleDescriptor.selectedScorerDescriptor(sample).scores();
|
16685
16740
|
if (scores.length === 1) {
|
16686
16741
|
return scores[0].rendered();
|
16687
16742
|
} else {
|
@@ -16775,7 +16830,7 @@ ${entry.value}</pre
|
|
16775
16830
|
scorer
|
16776
16831
|
}) => {
|
16777
16832
|
if (!sampleDescriptor) {
|
16778
|
-
return
|
16833
|
+
return m$1``;
|
16779
16834
|
}
|
16780
16835
|
const scoreInput = inputString(sample.input);
|
16781
16836
|
if (sample.choices && sample.choices.length > 0) {
|
@@ -16786,7 +16841,10 @@ ${entry.value}</pre
|
|
16786
16841
|
})
|
16787
16842
|
);
|
16788
16843
|
}
|
16789
|
-
const scorerDescriptor = sampleDescriptor.
|
16844
|
+
const scorerDescriptor = sampleDescriptor.evalDescriptor.scorerDescriptor(
|
16845
|
+
sample,
|
16846
|
+
{ scorer, name: scorer }
|
16847
|
+
);
|
16790
16848
|
const explanation = scorerDescriptor.explanation() || "(No Explanation)";
|
16791
16849
|
const answer = scorerDescriptor.answer();
|
16792
16850
|
const metadata = scorerDescriptor.metadata();
|
@@ -24775,7 +24833,7 @@ ${events}
|
|
24775
24833
|
}
|
24776
24834
|
};
|
24777
24835
|
const ToolEventView = ({ id, event, style: style2, depth }) => {
|
24778
|
-
var _a2;
|
24836
|
+
var _a2, _b2;
|
24779
24837
|
const { input, functionCall, inputType } = resolveToolInput(
|
24780
24838
|
event.function,
|
24781
24839
|
event.arguments
|
@@ -24791,7 +24849,7 @@ ${events}
|
|
24791
24849
|
functionCall=${functionCall}
|
24792
24850
|
input=${input}
|
24793
24851
|
inputType=${inputType}
|
24794
|
-
output=${event.result}
|
24852
|
+
output=${((_b2 = event.error) == null ? void 0 : _b2.message) || event.result}
|
24795
24853
|
mode="compact"
|
24796
24854
|
view=${event.view}
|
24797
24855
|
/>
|
@@ -25475,10 +25533,7 @@ ${events}
|
|
25475
25533
|
clamp: true
|
25476
25534
|
});
|
25477
25535
|
}
|
25478
|
-
const fullAnswer = sample && sampleDescriptor ? (
|
25479
|
-
// @ts-ignore
|
25480
|
-
sampleDescriptor.selectedScorer(sample).answer()
|
25481
|
-
) : void 0;
|
25536
|
+
const fullAnswer = sample && sampleDescriptor ? sampleDescriptor.selectedScorerDescriptor(sample).answer() : void 0;
|
25482
25537
|
if (fullAnswer) {
|
25483
25538
|
columns.push({
|
25484
25539
|
label: "Answer",
|
@@ -25640,27 +25695,27 @@ ${events}
|
|
25640
25695
|
class VirtualList extends x$1 {
|
25641
25696
|
constructor(props) {
|
25642
25697
|
super(props);
|
25698
|
+
/** @type {HTMLElement} */
|
25699
|
+
__publicField(this, "base");
|
25643
25700
|
this.state = {
|
25644
25701
|
height: 0,
|
25645
25702
|
offset: 0
|
25646
25703
|
};
|
25647
|
-
this.resize =
|
25648
|
-
|
25704
|
+
this.resize = () => {
|
25705
|
+
if (this.state.height !== this.base.offsetHeight) {
|
25706
|
+
this.setState({ height: this.base.offsetHeight });
|
25707
|
+
}
|
25708
|
+
};
|
25709
|
+
this.handleScroll = throttle$1(() => {
|
25710
|
+
if (this.base) {
|
25711
|
+
this.setState({ offset: this.base.scrollTop });
|
25712
|
+
}
|
25713
|
+
if (this.props.sync) {
|
25714
|
+
this.forceUpdate();
|
25715
|
+
}
|
25716
|
+
}, 100);
|
25649
25717
|
this.containerRef = b();
|
25650
25718
|
}
|
25651
|
-
resize() {
|
25652
|
-
if (this.state.height !== this.base.offsetHeight) {
|
25653
|
-
this.setState({ height: this.base.offsetHeight });
|
25654
|
-
}
|
25655
|
-
}
|
25656
|
-
handleScroll() {
|
25657
|
-
if (this.base) {
|
25658
|
-
this.setState({ offset: this.base.scrollTop });
|
25659
|
-
}
|
25660
|
-
if (this.props.sync) {
|
25661
|
-
this.forceUpdate();
|
25662
|
-
}
|
25663
|
-
}
|
25664
25719
|
componentDidUpdate() {
|
25665
25720
|
this.resize();
|
25666
25721
|
}
|
@@ -25816,7 +25871,7 @@ ${events}
|
|
25816
25871
|
[selectedIndex]
|
25817
25872
|
);
|
25818
25873
|
const listStyle = { ...style2, flex: "1", overflowY: "auto", outline: "none" };
|
25819
|
-
const { limit, answer, target } = gridColumns(sampleDescriptor);
|
25874
|
+
const { input, limit, answer, target } = gridColumns(sampleDescriptor);
|
25820
25875
|
const headerRow = m$1`<div
|
25821
25876
|
style=${{
|
25822
25877
|
display: "grid",
|
@@ -25830,7 +25885,7 @@ ${events}
|
|
25830
25885
|
}}
|
25831
25886
|
>
|
25832
25887
|
<div>Id</div>
|
25833
|
-
<div
|
25888
|
+
<div>${input !== "0" ? "Input" : ""}</div>
|
25834
25889
|
<div>${target !== "0" ? "Target" : ""}</div>
|
25835
25890
|
<div>${answer !== "0" ? "Answer" : ""}</div>
|
25836
25891
|
<div>${limit !== "0" ? "Limit" : ""}</div>
|
@@ -25986,7 +26041,7 @@ ${events}
|
|
25986
26041
|
>
|
25987
26042
|
${sample ? m$1`
|
25988
26043
|
<${MarkdownDiv}
|
25989
|
-
markdown=${sampleDescriptor == null ? void 0 : sampleDescriptor.
|
26044
|
+
markdown=${sampleDescriptor == null ? void 0 : sampleDescriptor.selectedScorerDescriptor(sample).answer()}
|
25990
26045
|
style=${{ paddingLeft: "0" }}
|
25991
26046
|
class="no-last-para-padding"
|
25992
26047
|
/>
|
@@ -26241,7 +26296,7 @@ ${events}
|
|
26241
26296
|
}
|
26242
26297
|
}
|
26243
26298
|
});
|
26244
|
-
const groupCount = samples.length / sampleDescriptor.epochs;
|
26299
|
+
const groupCount = samples.length / sampleDescriptor.evalDescriptor.epochs;
|
26245
26300
|
const itemCount = samples.length / groupCount;
|
26246
26301
|
const counter = getCounter(itemCount, groupCount, order2);
|
26247
26302
|
return (sample, index, previousSample) => {
|
@@ -26270,7 +26325,7 @@ ${events}
|
|
26270
26325
|
};
|
26271
26326
|
};
|
26272
26327
|
const groupByEpoch = (samples, sampleDescriptor, order2) => {
|
26273
|
-
const groupCount = sampleDescriptor.epochs;
|
26328
|
+
const groupCount = sampleDescriptor.evalDescriptor.epochs;
|
26274
26329
|
const itemCount = samples.length / groupCount;
|
26275
26330
|
const counter = getCounter(itemCount, groupCount, order2);
|
26276
26331
|
return (sample, index, previousSample) => {
|
@@ -28418,7 +28473,8 @@ self.onmessage = function (e) {
|
|
28418
28473
|
};
|
28419
28474
|
});
|
28420
28475
|
return Promise.resolve({
|
28421
|
-
files: logs
|
28476
|
+
files: logs,
|
28477
|
+
log_dir
|
28422
28478
|
});
|
28423
28479
|
} else if (log_file) {
|
28424
28480
|
let evalLog = cache.get();
|
@@ -28433,7 +28489,8 @@ self.onmessage = function (e) {
|
|
28433
28489
|
task_id: evalLog.eval.task_id
|
28434
28490
|
};
|
28435
28491
|
return {
|
28436
|
-
files: [result]
|
28492
|
+
files: [result],
|
28493
|
+
log_dir
|
28437
28494
|
};
|
28438
28495
|
} else {
|
28439
28496
|
throw new Error(
|
@@ -28623,7 +28680,7 @@ self.onmessage = function (e) {
|
|
28623
28680
|
}
|
28624
28681
|
}
|
28625
28682
|
}
|
28626
|
-
const MAX_BYTES =
|
28683
|
+
const MAX_BYTES = 50 * 1024 * 1024;
|
28627
28684
|
const openRemoteLogFile = async (api2, url, concurrency) => {
|
28628
28685
|
const queue = new AsyncQueue(concurrency);
|
28629
28686
|
const remoteZipFile = await openRemoteZipFile(
|
@@ -29063,7 +29120,7 @@ self.onmessage = function (e) {
|
|
29063
29120
|
val: kEpochDescVal
|
29064
29121
|
});
|
29065
29122
|
}
|
29066
|
-
if ((_a2 = sampleDescriptor == null ? void 0 : sampleDescriptor.
|
29123
|
+
if ((_a2 = sampleDescriptor == null ? void 0 : sampleDescriptor.selectedScoreDescriptor) == null ? void 0 : _a2.compare) {
|
29067
29124
|
options.push({
|
29068
29125
|
label: "score asc",
|
29069
29126
|
val: kScoreAscVal
|
@@ -29152,12 +29209,12 @@ self.onmessage = function (e) {
|
|
29152
29209
|
}
|
29153
29210
|
}
|
29154
29211
|
case kScoreAscVal:
|
29155
|
-
return samplesDescriptor.
|
29212
|
+
return samplesDescriptor.selectedScoreDescriptor.compare(
|
29156
29213
|
samplesDescriptor.selectedScore(a2).value,
|
29157
29214
|
samplesDescriptor.selectedScore(b2).value
|
29158
29215
|
);
|
29159
29216
|
case kScoreDescVal:
|
29160
|
-
return samplesDescriptor.
|
29217
|
+
return samplesDescriptor.selectedScoreDescriptor.compare(
|
29161
29218
|
samplesDescriptor.selectedScore(b2).value,
|
29162
29219
|
samplesDescriptor.selectedScore(a2).value
|
29163
29220
|
);
|
@@ -29181,11 +29238,11 @@ self.onmessage = function (e) {
|
|
29181
29238
|
});
|
29182
29239
|
}
|
29183
29240
|
};
|
29184
|
-
switch ((_a2 = descriptor == null ? void 0 : descriptor.
|
29241
|
+
switch ((_a2 = descriptor == null ? void 0 : descriptor.selectedScoreDescriptor) == null ? void 0 : _a2.scoreType) {
|
29185
29242
|
case kScoreTypePassFail: {
|
29186
29243
|
const options = [{ text: "All", value: "all" }];
|
29187
29244
|
options.push(
|
29188
|
-
...descriptor.
|
29245
|
+
...descriptor.selectedScoreDescriptor.categories.map((cat) => {
|
29189
29246
|
return { text: cat.text, value: cat.val };
|
29190
29247
|
})
|
29191
29248
|
);
|
@@ -29198,7 +29255,7 @@ self.onmessage = function (e) {
|
|
29198
29255
|
case kScoreTypeCategorical: {
|
29199
29256
|
const options = [{ text: "All", value: "all" }];
|
29200
29257
|
options.push(
|
29201
|
-
...descriptor.
|
29258
|
+
...descriptor.selectedScoreDescriptor.categories.map((cat) => {
|
29202
29259
|
return { text: cat, value: cat };
|
29203
29260
|
})
|
29204
29261
|
);
|
@@ -29226,12 +29283,12 @@ self.onmessage = function (e) {
|
|
29226
29283
|
`;
|
29227
29284
|
}
|
29228
29285
|
case kScoreTypeObject: {
|
29229
|
-
if (!descriptor.
|
29286
|
+
if (!descriptor.selectedScoreDescriptor.categories) {
|
29230
29287
|
return "";
|
29231
29288
|
}
|
29232
29289
|
const options = [{ text: "All", value: "all" }];
|
29233
29290
|
options.push(
|
29234
|
-
...descriptor.
|
29291
|
+
...descriptor.selectedScoreDescriptor.categories.map((cat) => {
|
29235
29292
|
return { text: cat.text, value: cat.value };
|
29236
29293
|
})
|
29237
29294
|
);
|
@@ -29640,11 +29697,13 @@ self.onmessage = function (e) {
|
|
29640
29697
|
if (status === "success") {
|
29641
29698
|
statusPanel = m$1`<${ResultsPanel} results="${results}" />`;
|
29642
29699
|
} else if (status === "cancelled") {
|
29643
|
-
statusPanel = m$1`<${
|
29700
|
+
statusPanel = m$1`<${CancelledPanel}
|
29644
29701
|
sampleCount=${(samples == null ? void 0 : samples.length) || 0}
|
29645
29702
|
/>`;
|
29646
29703
|
} else if (status === "started") {
|
29647
|
-
statusPanel = m$1`<${RunningPanel} />`;
|
29704
|
+
statusPanel = m$1`<${RunningPanel} sampleCount=${(samples == null ? void 0 : samples.length) || 0} />`;
|
29705
|
+
} else if (status === "error") {
|
29706
|
+
statusPanel = m$1`<${ErroredPanel} sampleCount=${(samples == null ? void 0 : samples.length) || 0} />`;
|
29648
29707
|
}
|
29649
29708
|
const navbarContents = logFileName ? m$1` <div
|
29650
29709
|
class="navbar-brand navbar-text mb-0"
|
@@ -29771,47 +29830,51 @@ self.onmessage = function (e) {
|
|
29771
29830
|
</nav>
|
29772
29831
|
`;
|
29773
29832
|
};
|
29774
|
-
const
|
29833
|
+
const StatusPanel = ({ icon, status, sampleCount }) => {
|
29775
29834
|
return m$1`<div
|
29776
29835
|
style=${{
|
29777
29836
|
padding: "1em",
|
29778
29837
|
marginTop: "0.5em",
|
29779
29838
|
textTransform: "uppercase",
|
29780
|
-
fontSize: FontSize.smaller
|
29839
|
+
fontSize: FontSize.smaller,
|
29840
|
+
display: "grid",
|
29841
|
+
gridTemplateColumns: "auto auto"
|
29781
29842
|
}}
|
29782
29843
|
>
|
29783
29844
|
<i
|
29784
|
-
class="${
|
29785
|
-
style=${{ fontSize: FontSize.large, marginRight: "0.3em" }}
|
29786
|
-
/>
|
29787
|
-
cancelled (${sampleCount} ${sampleCount === 1 ? "sample" : "samples"})
|
29788
|
-
</div>`;
|
29789
|
-
};
|
29790
|
-
const RunningPanel = () => {
|
29791
|
-
return m$1`
|
29792
|
-
<div
|
29845
|
+
class="${icon}"
|
29793
29846
|
style=${{
|
29794
|
-
|
29795
|
-
|
29796
|
-
|
29797
|
-
}}
|
29798
|
-
>
|
29799
|
-
<div>
|
29800
|
-
<i class=${ApplicationIcons.running} />
|
29801
|
-
</div>
|
29802
|
-
<div
|
29803
|
-
style=${{
|
29804
|
-
marginLeft: "0.3em",
|
29805
|
-
paddingTop: "0.2em",
|
29806
|
-
fontSize: FontSize.smaller,
|
29807
|
-
...TextStyle.label,
|
29808
|
-
...TextStyle.secondary
|
29847
|
+
fontSize: FontSize.large,
|
29848
|
+
marginRight: "0.3em",
|
29849
|
+
marginTop: "-0.1em"
|
29809
29850
|
}}
|
29810
|
-
|
29811
|
-
|
29812
|
-
</div>
|
29851
|
+
/>
|
29852
|
+
<div>
|
29853
|
+
<div>${status}</div>
|
29854
|
+
<div>(${sampleCount} ${sampleCount === 1 ? "sample" : "samples"})</div>
|
29813
29855
|
</div>
|
29814
|
-
|
29856
|
+
</div>`;
|
29857
|
+
};
|
29858
|
+
const CancelledPanel = ({ sampleCount }) => {
|
29859
|
+
return m$1`<${StatusPanel}
|
29860
|
+
icon=${ApplicationIcons.logging.info}
|
29861
|
+
status="Cancelled"
|
29862
|
+
sampleCount=${sampleCount}
|
29863
|
+
/>`;
|
29864
|
+
};
|
29865
|
+
const ErroredPanel = ({ sampleCount }) => {
|
29866
|
+
return m$1`<${StatusPanel}
|
29867
|
+
icon=${ApplicationIcons.logging.error}
|
29868
|
+
status="Task Failed"
|
29869
|
+
sampleCount=${sampleCount}
|
29870
|
+
/>`;
|
29871
|
+
};
|
29872
|
+
const RunningPanel = ({ sampleCount }) => {
|
29873
|
+
return m$1`<${StatusPanel}
|
29874
|
+
icon=${ApplicationIcons.running}
|
29875
|
+
status="Running"
|
29876
|
+
sampleCount=${sampleCount}
|
29877
|
+
/>`;
|
29815
29878
|
};
|
29816
29879
|
const ResultsPanel = ({ results }) => {
|
29817
29880
|
var _a2, _b2;
|
@@ -29879,7 +29942,8 @@ self.onmessage = function (e) {
|
|
29879
29942
|
...TextStyle.secondary
|
29880
29943
|
}}
|
29881
29944
|
>
|
29882
|
-
${
|
29945
|
+
${// @ts-expect-error
|
29946
|
+
metric.reducer}
|
29883
29947
|
</div>` : "";
|
29884
29948
|
return m$1`<div style=${{ paddingLeft: isFirst ? "0" : "1em" }}>
|
29885
29949
|
<div
|
@@ -30032,7 +30096,7 @@ self.onmessage = function (e) {
|
|
30032
30096
|
}, [divRef, task_id]);
|
30033
30097
|
const resolvedTabs = T(() => {
|
30034
30098
|
const resolvedTabs2 = {};
|
30035
|
-
if (
|
30099
|
+
if (sampleMode !== "none") {
|
30036
30100
|
resolvedTabs2.samples = {
|
30037
30101
|
id: kEvalWorkspaceTabId,
|
30038
30102
|
scrollable: samples.length === 1,
|
@@ -30364,7 +30428,10 @@ self.onmessage = function (e) {
|
|
30364
30428
|
}
|
30365
30429
|
};
|
30366
30430
|
const FindBand = ({ hideBand }) => {
|
30367
|
-
const searchBoxRef = A(
|
30431
|
+
const searchBoxRef = A(
|
30432
|
+
/** @type {HTMLInputElement|null} */
|
30433
|
+
null
|
30434
|
+
);
|
30368
30435
|
y(() => {
|
30369
30436
|
searchBoxRef.current.focus();
|
30370
30437
|
}, []);
|
@@ -30384,13 +30451,16 @@ self.onmessage = function (e) {
|
|
30384
30451
|
}
|
30385
30452
|
return expandablePanelEl;
|
30386
30453
|
};
|
30387
|
-
const focusedElement =
|
30454
|
+
const focusedElement = (
|
30455
|
+
/** @type {HTMLElement} */
|
30456
|
+
document.activeElement
|
30457
|
+
);
|
30388
30458
|
const result = window.find(term, false, !!back, false, false, true, false);
|
30389
30459
|
const noResultEl = window.document.getElementById(
|
30390
30460
|
"inspect-find-no-results"
|
30391
30461
|
);
|
30392
30462
|
if (result) {
|
30393
|
-
noResultEl.style.opacity = 0;
|
30463
|
+
noResultEl.style.opacity = "0";
|
30394
30464
|
const selection = window.getSelection();
|
30395
30465
|
if (selection.rangeCount > 0) {
|
30396
30466
|
const parentPanel = parentExpandablePanel(selection);
|
@@ -30411,7 +30481,7 @@ self.onmessage = function (e) {
|
|
30411
30481
|
}, 100);
|
30412
30482
|
}
|
30413
30483
|
} else {
|
30414
|
-
noResultEl.style.opacity = 1;
|
30484
|
+
noResultEl.style.opacity = "1";
|
30415
30485
|
}
|
30416
30486
|
if (focusedElement) {
|
30417
30487
|
focusedElement.focus();
|
@@ -30504,32 +30574,25 @@ self.onmessage = function (e) {
|
|
30504
30574
|
</button>
|
30505
30575
|
</div>`;
|
30506
30576
|
};
|
30507
|
-
const
|
30577
|
+
const createEvalDescriptor = (scores, samples, epochs) => {
|
30508
30578
|
if (!samples) {
|
30509
30579
|
return void 0;
|
30510
30580
|
}
|
30511
|
-
const
|
30512
|
-
if (sample.scores
|
30513
|
-
return sample.scores[scorer];
|
30514
|
-
} else {
|
30515
|
-
return void 0;
|
30516
|
-
}
|
30517
|
-
};
|
30518
|
-
const scoreValue = (sample) => {
|
30519
|
-
if (Object.keys(sample.scores).length === 0 || !selectedScore) {
|
30581
|
+
const scoreValue = (sample, scoreLabel) => {
|
30582
|
+
if (Object.keys(sample.scores).length === 0 || !scoreLabel) {
|
30520
30583
|
return void 0;
|
30521
30584
|
}
|
30522
|
-
if (
|
30523
|
-
return sample.scores[
|
30524
|
-
} else if (sample.scores[
|
30525
|
-
return sample.scores[
|
30585
|
+
if (scoreLabel.scorer !== scoreLabel.name && sample.scores[scoreLabel.scorer] && sample.scores[scoreLabel.scorer].value) {
|
30586
|
+
return sample.scores[scoreLabel.scorer].value[scoreLabel.name];
|
30587
|
+
} else if (sample.scores[scoreLabel.name]) {
|
30588
|
+
return sample.scores[scoreLabel.name].value;
|
30526
30589
|
} else {
|
30527
30590
|
return void 0;
|
30528
30591
|
}
|
30529
30592
|
};
|
30530
30593
|
const scoreAnswer = (sample, scorer) => {
|
30531
30594
|
if (sample) {
|
30532
|
-
const sampleScore =
|
30595
|
+
const sampleScore = sample.scores[scorer];
|
30533
30596
|
if (sampleScore && sampleScore.answer) {
|
30534
30597
|
return sampleScore.answer;
|
30535
30598
|
}
|
@@ -30539,7 +30602,7 @@ self.onmessage = function (e) {
|
|
30539
30602
|
};
|
30540
30603
|
const scoreExplanation = (sample, scorer) => {
|
30541
30604
|
if (sample) {
|
30542
|
-
const sampleScore =
|
30605
|
+
const sampleScore = sample.scores[scorer];
|
30543
30606
|
if (sampleScore && sampleScore.explanation) {
|
30544
30607
|
return sampleScore.explanation;
|
30545
30608
|
}
|
@@ -30548,48 +30611,158 @@ self.onmessage = function (e) {
|
|
30548
30611
|
};
|
30549
30612
|
const scoreMetadata = (sample, scorer) => {
|
30550
30613
|
if (sample) {
|
30551
|
-
const sampleScore =
|
30614
|
+
const sampleScore = sample.scores[scorer];
|
30552
30615
|
if (sampleScore && sampleScore.metadata) {
|
30553
30616
|
return sampleScore.metadata;
|
30554
30617
|
}
|
30555
30618
|
}
|
30556
30619
|
return void 0;
|
30557
30620
|
};
|
30558
|
-
const
|
30559
|
-
|
30560
|
-
|
30561
|
-
|
30562
|
-
|
30621
|
+
const scoreLabelKey = (scoreLabel) => {
|
30622
|
+
if (!scoreLabel) {
|
30623
|
+
return "No score key";
|
30624
|
+
}
|
30625
|
+
return `${scoreLabel.scorer}.${scoreLabel.name}`;
|
30626
|
+
};
|
30627
|
+
const scoreDescriptorMap = /* @__PURE__ */ new Map();
|
30628
|
+
for (const scoreLabel of scores) {
|
30629
|
+
const uniqScoreValues = [
|
30630
|
+
...new Set(
|
30631
|
+
samples.filter((sample) => !!sample.scores).filter((sample) => {
|
30632
|
+
if (!scoreLabel) {
|
30633
|
+
return true;
|
30634
|
+
}
|
30635
|
+
if (scoreLabel.scorer !== scoreLabel.name) {
|
30636
|
+
return Object.keys(sample.scores).includes(scoreLabel.scorer) && Object.keys(sample.scores[scoreLabel.scorer].value).includes(
|
30637
|
+
scoreLabel.name
|
30638
|
+
);
|
30639
|
+
} else {
|
30640
|
+
return Object.keys(sample.scores).includes(scoreLabel.name);
|
30641
|
+
}
|
30642
|
+
}).map((sample) => {
|
30643
|
+
return scoreValue(sample, scoreLabel);
|
30644
|
+
}).filter((value) => {
|
30645
|
+
return value !== null;
|
30646
|
+
})
|
30647
|
+
)
|
30648
|
+
];
|
30649
|
+
const uniqScoreTypes = [
|
30650
|
+
...new Set(uniqScoreValues.map((scoreValue2) => typeof scoreValue2))
|
30651
|
+
];
|
30652
|
+
for (const categorizer of scoreCategorizers) {
|
30653
|
+
const scoreDescriptor2 = categorizer.describe(
|
30654
|
+
uniqScoreValues,
|
30655
|
+
uniqScoreTypes
|
30656
|
+
);
|
30657
|
+
if (scoreDescriptor2) {
|
30658
|
+
scoreDescriptorMap.set(scoreLabelKey(scoreLabel), scoreDescriptor2);
|
30659
|
+
break;
|
30660
|
+
}
|
30661
|
+
}
|
30662
|
+
}
|
30663
|
+
const scoreDescriptor = (scoreLabel) => {
|
30664
|
+
return scoreDescriptorMap.get(scoreLabelKey(scoreLabel));
|
30665
|
+
};
|
30666
|
+
const scoreRendered = (sample, scoreLabel) => {
|
30667
|
+
const descriptor = scoreDescriptor(scoreLabel);
|
30668
|
+
const score2 = scoreValue(sample, scoreLabel);
|
30669
|
+
if (score2 === null || score2 === "undefined") {
|
30670
|
+
return "null";
|
30671
|
+
} else if (descriptor && descriptor.render) {
|
30672
|
+
return descriptor.render(score2);
|
30673
|
+
} else {
|
30674
|
+
return score2;
|
30675
|
+
}
|
30676
|
+
};
|
30677
|
+
const scorerDescriptor = (sample, scoreLabel) => {
|
30678
|
+
return {
|
30679
|
+
metadata: () => {
|
30680
|
+
return scoreMetadata(sample, scoreLabel.scorer);
|
30681
|
+
},
|
30682
|
+
explanation: () => {
|
30683
|
+
return scoreExplanation(sample, scoreLabel.scorer);
|
30684
|
+
},
|
30685
|
+
answer: () => {
|
30686
|
+
return scoreAnswer(sample, scoreLabel.scorer);
|
30687
|
+
},
|
30688
|
+
scores: () => {
|
30689
|
+
if (!sample || !sample.scores) {
|
30690
|
+
return [];
|
30563
30691
|
}
|
30564
|
-
|
30565
|
-
|
30566
|
-
|
30567
|
-
|
30692
|
+
const myScoreDescriptor = scoreDescriptor(scoreLabel);
|
30693
|
+
if (!myScoreDescriptor) {
|
30694
|
+
return [];
|
30695
|
+
}
|
30696
|
+
const scoreNames = scores.map((score2) => {
|
30697
|
+
return score2.name;
|
30698
|
+
});
|
30699
|
+
const sampleScorer = sample.scores[scoreLabel.scorer];
|
30700
|
+
const scoreVal = sampleScorer.value;
|
30701
|
+
if (typeof scoreVal === "object") {
|
30702
|
+
const names = Object.keys(scoreVal);
|
30703
|
+
if (names.find((name) => {
|
30704
|
+
return scoreNames.includes(name);
|
30705
|
+
})) {
|
30706
|
+
const scores2 = names.map((name) => {
|
30707
|
+
return {
|
30708
|
+
name,
|
30709
|
+
rendered: () => {
|
30710
|
+
return myScoreDescriptor.render(scoreVal[name]);
|
30711
|
+
}
|
30712
|
+
};
|
30713
|
+
});
|
30714
|
+
return scores2;
|
30715
|
+
} else {
|
30716
|
+
return [
|
30717
|
+
{
|
30718
|
+
name: scoreLabel.scorer,
|
30719
|
+
rendered: () => {
|
30720
|
+
return myScoreDescriptor.render(scoreVal);
|
30721
|
+
}
|
30722
|
+
}
|
30723
|
+
];
|
30724
|
+
}
|
30568
30725
|
} else {
|
30569
|
-
return
|
30726
|
+
return [
|
30727
|
+
{
|
30728
|
+
name: scoreLabel.scorer,
|
30729
|
+
rendered: () => {
|
30730
|
+
return myScoreDescriptor.render(scoreVal);
|
30731
|
+
}
|
30732
|
+
}
|
30733
|
+
];
|
30570
30734
|
}
|
30571
|
-
}
|
30572
|
-
|
30573
|
-
|
30574
|
-
|
30575
|
-
|
30576
|
-
|
30577
|
-
|
30578
|
-
|
30579
|
-
|
30580
|
-
|
30581
|
-
|
30582
|
-
|
30583
|
-
|
30584
|
-
|
30585
|
-
|
30586
|
-
|
30735
|
+
}
|
30736
|
+
};
|
30737
|
+
};
|
30738
|
+
const score = (sample, scoreLabel) => {
|
30739
|
+
return {
|
30740
|
+
value: scoreValue(sample, scoreLabel),
|
30741
|
+
render: () => {
|
30742
|
+
return scoreRendered(sample, scoreLabel);
|
30743
|
+
}
|
30744
|
+
};
|
30745
|
+
};
|
30746
|
+
return {
|
30747
|
+
epochs,
|
30748
|
+
samples,
|
30749
|
+
scores,
|
30750
|
+
scorerDescriptor,
|
30751
|
+
scoreDescriptor,
|
30752
|
+
score,
|
30753
|
+
scoreAnswer
|
30754
|
+
};
|
30755
|
+
};
|
30756
|
+
const createSamplesDescriptor = (evalDescriptor, selectedScore) => {
|
30757
|
+
if (!evalDescriptor) {
|
30758
|
+
return void 0;
|
30587
30759
|
}
|
30588
|
-
const sizes = samples.reduce(
|
30760
|
+
const sizes = evalDescriptor.samples.reduce(
|
30589
30761
|
(previous, current) => {
|
30590
30762
|
var _a2;
|
30591
30763
|
const text2 = inputString(current.input).join(" ");
|
30592
|
-
const
|
30764
|
+
const scoreValue = evalDescriptor.score(current, selectedScore).value;
|
30765
|
+
const scoreText = scoreValue ? String(scoreValue) : current.error ? String(current.error) : "";
|
30593
30766
|
previous[0] = Math.min(Math.max(previous[0], text2.length), 300);
|
30594
30767
|
previous[1] = Math.min(
|
30595
30768
|
Math.max(previous[1], arrayToString(current.target).length),
|
@@ -30598,7 +30771,7 @@ self.onmessage = function (e) {
|
|
30598
30771
|
previous[2] = Math.min(
|
30599
30772
|
Math.max(
|
30600
30773
|
previous[2],
|
30601
|
-
((_a2 = scoreAnswer(current, selectedScore == null ? void 0 : selectedScore.name)) == null ? void 0 : _a2.length) || 0
|
30774
|
+
((_a2 = evalDescriptor.scoreAnswer(current, selectedScore == null ? void 0 : selectedScore.name)) == null ? void 0 : _a2.length) || 0
|
30602
30775
|
),
|
30603
30776
|
300
|
30604
30777
|
);
|
@@ -30642,91 +30815,12 @@ self.onmessage = function (e) {
|
|
30642
30815
|
score: maxSizes.score / base2
|
30643
30816
|
}
|
30644
30817
|
};
|
30645
|
-
const scoreRendered = (sample) => {
|
30646
|
-
const score2 = scoreValue(sample);
|
30647
|
-
if (score2 === null || score2 === "undefined") {
|
30648
|
-
return "null";
|
30649
|
-
} else if (scoreDescriptor.render) {
|
30650
|
-
return scoreDescriptor.render(score2);
|
30651
|
-
} else {
|
30652
|
-
return score2;
|
30653
|
-
}
|
30654
|
-
};
|
30655
|
-
const scorerDescriptor = (sample, scorer) => {
|
30656
|
-
return {
|
30657
|
-
metadata: () => {
|
30658
|
-
return scoreMetadata(sample, scorer);
|
30659
|
-
},
|
30660
|
-
explanation: () => {
|
30661
|
-
return scoreExplanation(sample, scorer);
|
30662
|
-
},
|
30663
|
-
answer: () => {
|
30664
|
-
return scoreAnswer(sample, scorer);
|
30665
|
-
},
|
30666
|
-
scores: () => {
|
30667
|
-
if (!sample || !sample.scores) {
|
30668
|
-
return [];
|
30669
|
-
}
|
30670
|
-
const scoreNames = scorers.map((score2) => {
|
30671
|
-
return score2.name;
|
30672
|
-
});
|
30673
|
-
const sampleScorer = sample.scores[scorer];
|
30674
|
-
const scoreVal = sampleScorer.value;
|
30675
|
-
if (typeof scoreVal === "object") {
|
30676
|
-
const names = Object.keys(scoreVal);
|
30677
|
-
if (names.find((name) => {
|
30678
|
-
return scoreNames.includes(name);
|
30679
|
-
})) {
|
30680
|
-
const scores = names.map((name) => {
|
30681
|
-
return {
|
30682
|
-
name,
|
30683
|
-
rendered: () => {
|
30684
|
-
return scoreDescriptor.render(scoreVal[name]);
|
30685
|
-
}
|
30686
|
-
};
|
30687
|
-
});
|
30688
|
-
return scores;
|
30689
|
-
} else {
|
30690
|
-
return [
|
30691
|
-
{
|
30692
|
-
name: scorer,
|
30693
|
-
rendered: () => {
|
30694
|
-
return scoreDescriptor.render(scoreVal);
|
30695
|
-
}
|
30696
|
-
}
|
30697
|
-
];
|
30698
|
-
}
|
30699
|
-
} else {
|
30700
|
-
return [
|
30701
|
-
{
|
30702
|
-
name: scorer,
|
30703
|
-
rendered: () => {
|
30704
|
-
return scoreDescriptor.render(scoreVal);
|
30705
|
-
}
|
30706
|
-
}
|
30707
|
-
];
|
30708
|
-
}
|
30709
|
-
}
|
30710
|
-
};
|
30711
|
-
};
|
30712
30818
|
return {
|
30713
|
-
|
30714
|
-
epochs,
|
30819
|
+
evalDescriptor,
|
30715
30820
|
messageShape,
|
30716
|
-
|
30717
|
-
|
30718
|
-
|
30719
|
-
render: () => {
|
30720
|
-
return scoreRendered(sample);
|
30721
|
-
}
|
30722
|
-
};
|
30723
|
-
},
|
30724
|
-
scorer: (sample, scorer) => {
|
30725
|
-
return scorerDescriptor(sample, scorer);
|
30726
|
-
},
|
30727
|
-
selectedScorer: (sample) => {
|
30728
|
-
return scorerDescriptor(sample, selectedScore == null ? void 0 : selectedScore.scorer);
|
30729
|
-
}
|
30821
|
+
selectedScoreDescriptor: evalDescriptor.scoreDescriptor(selectedScore),
|
30822
|
+
selectedScore: (sample) => evalDescriptor.score(sample, selectedScore),
|
30823
|
+
selectedScorerDescriptor: (sample) => evalDescriptor.scorerDescriptor(sample, selectedScore)
|
30730
30824
|
};
|
30731
30825
|
};
|
30732
30826
|
const scoreCategorizers = [
|
@@ -31314,7 +31408,7 @@ self.onmessage = function (e) {
|
|
31314
31408
|
]
|
31315
31409
|
);
|
31316
31410
|
y(() => {
|
31317
|
-
var _a3;
|
31411
|
+
var _a3, _b3;
|
31318
31412
|
const samples = ((_a3 = selectedLog == null ? void 0 : selectedLog.contents) == null ? void 0 : _a3.sampleSummaries) || [];
|
31319
31413
|
const filtered = samples.filter((sample) => {
|
31320
31414
|
if (epoch && epoch !== "all") {
|
@@ -31331,7 +31425,7 @@ self.onmessage = function (e) {
|
|
31331
31425
|
});
|
31332
31426
|
const { sorted, order: order2 } = sortSamples(sort, filtered, samplesDescriptor);
|
31333
31427
|
let grouping = "none";
|
31334
|
-
if ((samplesDescriptor == null ? void 0 : samplesDescriptor.epochs) > 1) {
|
31428
|
+
if (((_b3 = samplesDescriptor == null ? void 0 : samplesDescriptor.evalDescriptor) == null ? void 0 : _b3.epochs) > 1) {
|
31335
31429
|
if (byEpoch(sort) || epoch !== "all") {
|
31336
31430
|
grouping = "epoch";
|
31337
31431
|
} else if (bySample(sort)) {
|
@@ -31342,15 +31436,17 @@ self.onmessage = function (e) {
|
|
31342
31436
|
setGroupBy(grouping);
|
31343
31437
|
setGroupByOrder(order2);
|
31344
31438
|
}, [selectedLog, filter, sort, epoch]);
|
31345
|
-
const
|
31439
|
+
const evalDescriptor = T(() => {
|
31346
31440
|
var _a3, _b3, _c2, _d2;
|
31347
|
-
return
|
31441
|
+
return createEvalDescriptor(
|
31348
31442
|
scores,
|
31349
31443
|
(_a3 = selectedLog.contents) == null ? void 0 : _a3.sampleSummaries,
|
31350
|
-
((_d2 = (_c2 = (_b3 = selectedLog.contents) == null ? void 0 : _b3.eval) == null ? void 0 : _c2.config) == null ? void 0 : _d2.epochs) || 1
|
31351
|
-
score
|
31444
|
+
((_d2 = (_c2 = (_b3 = selectedLog.contents) == null ? void 0 : _b3.eval) == null ? void 0 : _c2.config) == null ? void 0 : _d2.epochs) || 1
|
31352
31445
|
);
|
31353
|
-
}, [selectedLog, scores
|
31446
|
+
}, [selectedLog, scores]);
|
31447
|
+
const samplesDescriptor = T(() => {
|
31448
|
+
return createSamplesDescriptor(evalDescriptor, score);
|
31449
|
+
}, [evalDescriptor, score]);
|
31354
31450
|
const refreshSampleTab = q(
|
31355
31451
|
(sample) => {
|
31356
31452
|
if (selectedSampleTab === void 0) {
|
@@ -31458,9 +31554,9 @@ self.onmessage = function (e) {
|
|
31458
31554
|
*/
|
31459
31555
|
(log) => {
|
31460
31556
|
const hasSamples = !!log.sampleSummaries && log.sampleSummaries.length > 0;
|
31461
|
-
const showSamples =
|
31557
|
+
const showSamples = hasSamples;
|
31462
31558
|
setSelectedWorkspaceTab(
|
31463
|
-
|
31559
|
+
log.status !== "error" && hasSamples ? kEvalWorkspaceTabId : kInfoWorkspaceTabId
|
31464
31560
|
);
|
31465
31561
|
const scorer = defaultScorer(log);
|
31466
31562
|
const scorers = defaultScorers(log);
|