@barivia/barsom-mcp 0.15.0 → 0.15.4
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.
- package/README.md +3 -2
- package/dist/index.js +1 -1
- package/dist/inference_prepare.js +18 -0
- package/dist/job_status_format.js +92 -0
- package/dist/shared.js +1 -1
- package/dist/tools/datasets.js +59 -9
- package/dist/tools/inference.js +5 -0
- package/dist/tools/jobs.js +17 -18
- package/dist/tools/results.js +2 -2
- package/dist/tools/train.js +37 -10
- package/dist/tools/training_monitor.js +17 -3
- package/dist/train_finalize.js +25 -0
- package/dist/train_submit_message.js +52 -0
- package/dist/views/src/views/training-monitor/index.html +20 -13
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getVizPort } from "./shared.js";
|
|
2
|
+
export function buildTrainSubmitExtras(opts) {
|
|
3
|
+
const { newJobId, totalRows, hasTransforms, prepareJobId, variantPrefix, paramSummary, impute, resultsHint } = opts;
|
|
4
|
+
const monitorUrl = getVizPort() > 0
|
|
5
|
+
? `http://localhost:${getVizPort()}/viz/training-monitor?mode=standalone&job_id=${encodeURIComponent(newJobId)}`
|
|
6
|
+
: null;
|
|
7
|
+
let msg = `Job submitted (${variantPrefix}, ${paramSummary}). `;
|
|
8
|
+
if (prepareJobId) {
|
|
9
|
+
msg += `Preprocessing job prepare_training_matrix (${prepareJobId}) runs on worker-io first; train job ${newJobId} starts after it completes. Poll jobs(action=status, job_id="${prepareJobId}") until completed, then poll the train job. `;
|
|
10
|
+
}
|
|
11
|
+
msg += `Recommended: training_monitor(job_id="${newJobId}")`;
|
|
12
|
+
if (monitorUrl)
|
|
13
|
+
msg += ` or open ${monitorUrl}`;
|
|
14
|
+
msg += ` while polling jobs(action=status, job_id="${newJobId}") every 60–120s for large jobs. `;
|
|
15
|
+
msg += `When status is completed, check jobs(action=status) for finalize_job_id — if present, poll that finalize_training job before results(action=get). `;
|
|
16
|
+
msg += `Then use results(action=get, job_id="${newJobId}")`;
|
|
17
|
+
if (resultsHint) {
|
|
18
|
+
msg += ` to ${resultsHint}`;
|
|
19
|
+
}
|
|
20
|
+
else if (impute) {
|
|
21
|
+
msg += ` for the map and imputed.csv`;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
msg += ` to view the map and metrics`;
|
|
25
|
+
}
|
|
26
|
+
msg += `.`;
|
|
27
|
+
if (totalRows >= 1_000_000 || hasTransforms) {
|
|
28
|
+
msg += ` Large-table note: progress may stay low during staging preprocess before epochs start.`;
|
|
29
|
+
if (hasTransforms && totalRows >= 1_000_000) {
|
|
30
|
+
if (prepareJobId) {
|
|
31
|
+
msg += ` Transforms run in prepare_training_matrix on worker-io (full dataset, no CSV re-download on GPU).`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
msg += ` Transforms require prepare_training_matrix on worker-io for staged datasets; the API enqueues it automatically when needed.`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const pollSteps = prepareJobId
|
|
39
|
+
? [
|
|
40
|
+
`1) jobs(action=status, job_id="${prepareJobId}") until prepare completes`,
|
|
41
|
+
`2) jobs(action=status, job_id="${newJobId}") every 60–120s until completed`,
|
|
42
|
+
`3) if finalize_job_id is set, poll it until completed`,
|
|
43
|
+
`4) results(action=download, job_id="${newJobId}", folder=".", include_json=true)`,
|
|
44
|
+
]
|
|
45
|
+
: [
|
|
46
|
+
`1) training_monitor(job_id="${newJobId}")`,
|
|
47
|
+
`2) jobs(action=status, job_id="${newJobId}") every 60–120s until completed`,
|
|
48
|
+
`3) if finalize_job_id is set, poll it until completed`,
|
|
49
|
+
`4) results(action=download, job_id="${newJobId}", folder=".", include_json=true)`,
|
|
50
|
+
];
|
|
51
|
+
return { message: msg, suggested_next_step: pollSteps.join(" → ") };
|
|
52
|
+
}
|