@tuned-tensor/cli 0.25.0 → 0.26.1
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 +89 -12
- package/dist/{chunk-UCJCWJ6F.js → chunk-4BHDPRYD.js} +17 -13
- package/dist/chunk-4BHDPRYD.js.map +1 -0
- package/dist/{chunk-7RJGLRMO.js → chunk-FLRRDP3M.js} +1985 -576
- package/dist/chunk-FLRRDP3M.js.map +1 -0
- package/dist/index.js +2136 -1852
- package/dist/index.js.map +1 -1
- package/dist/local-runtime.js +47 -3
- package/dist/local-runtime.js.map +1 -1
- package/dist/{prefetch-GP3OPUUL.js → prefetch-DH365HNN.js} +2 -2
- package/docs/local-runtime/architecture.md +51 -0
- package/docs/local-runtime/aws-gpu.md +15 -0
- package/docs/local-runtime/background-runs.md +77 -0
- package/docs/local-runtime/decision.md +5 -0
- package/docs/local-runtime/serving.md +11 -2
- package/docs/spec-workflow.md +72 -2
- package/package.json +1 -1
- package/training/adapter/src/evaluate.py +127 -34
- package/training/adapter/src/model_contract.py +13 -0
- package/training/adapter/src/serve.py +30 -0
- package/training/adapter/src/train.py +5 -1
- package/dist/chunk-7RJGLRMO.js.map +0 -1
- package/dist/chunk-UCJCWJ6F.js.map +0 -1
- /package/dist/{prefetch-GP3OPUUL.js.map → prefetch-DH365HNN.js.map} +0 -0
package/dist/local-runtime.js
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
exampleToChatRow,
|
|
22
22
|
examplesFromChatJsonl,
|
|
23
23
|
examplesFromSpec,
|
|
24
|
+
executeDatasetSplit,
|
|
24
25
|
fingerprintLocalBaseModel,
|
|
25
26
|
foundationPlaceholderIssues,
|
|
26
27
|
generatedPlaceholderIssues,
|
|
@@ -28,6 +29,7 @@ import {
|
|
|
28
29
|
huggingFaceDataset,
|
|
29
30
|
initLocalRunnerConfigFile,
|
|
30
31
|
initLocalSpecFile,
|
|
32
|
+
inspectDatasetFile,
|
|
31
33
|
isTerminalRunState,
|
|
32
34
|
loadJsonFile,
|
|
33
35
|
loadLocalRunInput,
|
|
@@ -40,6 +42,7 @@ import {
|
|
|
40
42
|
parseLocalRunnerConfig,
|
|
41
43
|
pipelineForRunInput,
|
|
42
44
|
prefetchHuggingFaceDataset,
|
|
45
|
+
prepareDatasetSplit,
|
|
43
46
|
resolveDownloadConfig,
|
|
44
47
|
resolveLocalRunInputPaths,
|
|
45
48
|
resolveProjectConfig,
|
|
@@ -53,7 +56,7 @@ import {
|
|
|
53
56
|
validateLocalFineTuneInput,
|
|
54
57
|
validateLocalPipeline,
|
|
55
58
|
writePrivateJsonAtomic
|
|
56
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-FLRRDP3M.js";
|
|
57
60
|
import {
|
|
58
61
|
applySpecLock,
|
|
59
62
|
assertArtifactManifest,
|
|
@@ -122,7 +125,7 @@ import {
|
|
|
122
125
|
withOfflineHuggingFaceCacheEnvironment,
|
|
123
126
|
withProgressHeartbeat,
|
|
124
127
|
writeSpecLockEntry
|
|
125
|
-
} from "./chunk-
|
|
128
|
+
} from "./chunk-4BHDPRYD.js";
|
|
126
129
|
|
|
127
130
|
// src/local-runtime/index.ts
|
|
128
131
|
import { readFileSync as readFileSync3, realpathSync } from "fs";
|
|
@@ -962,6 +965,7 @@ Commands:
|
|
|
962
965
|
serve <model-id|active|base|foundation> [--config local-runner.json] [--host 127.0.0.1] [--port 8000]
|
|
963
966
|
runs list|get|events|report|compare|audit [args] [--config local-runner.json]
|
|
964
967
|
models list|get|verify|prefetch|verify-base|active|activate|rollback|serve [args] [--config local-runner.json]
|
|
968
|
+
datasets inspect|split <data.jsonl> [--output directory --train .8 --validation .1 --test .1]
|
|
965
969
|
datasets prefetch|verify [tunedtensor.json] [--repo org/name --training path ...]
|
|
966
970
|
assets list|path|verify [org/name[@revision]]
|
|
967
971
|
|
|
@@ -1131,9 +1135,33 @@ var COMMAND_GROUPS = {
|
|
|
1131
1135
|
}
|
|
1132
1136
|
},
|
|
1133
1137
|
datasets: {
|
|
1134
|
-
description: "
|
|
1138
|
+
description: "Inspect and split local chat JSONL, or download and verify Hugging Face datasets.",
|
|
1135
1139
|
defaultSubcommand: "prefetch",
|
|
1136
1140
|
subcommands: {
|
|
1141
|
+
inspect: {
|
|
1142
|
+
usage: "tt datasets inspect <data.jsonl>",
|
|
1143
|
+
description: "Validate local chat JSONL and report row count, hash, and bounded samples without changes.",
|
|
1144
|
+
options: [],
|
|
1145
|
+
minPositionals: 1,
|
|
1146
|
+
maxPositionals: 1
|
|
1147
|
+
},
|
|
1148
|
+
split: {
|
|
1149
|
+
usage: "tt datasets split <data.jsonl> --output <new-directory> [options]",
|
|
1150
|
+
description: "Partition unsplit chat JSONL without changing the source or spec. Accepts a workspace path or pinned hf://datasets/org/repo@commit/file reference from a recorded download. Keep duplicate prompts together; preserve metadata.",
|
|
1151
|
+
options: [
|
|
1152
|
+
{ name: "--output", value: "directory", description: "New output directory inside the workspace (parent must exist)" },
|
|
1153
|
+
{ name: "--train", value: "ratio", description: "Training fraction (default 0.8)" },
|
|
1154
|
+
{ name: "--validation", value: "ratio", description: "Validation fraction (default 0.1)" },
|
|
1155
|
+
{ name: "--test", value: "ratio", description: "Test fraction (default 0.1); set 0 for train/validation only" },
|
|
1156
|
+
{ name: "--seed", value: "seed", description: "Reproducible random group assignment (default 42)" },
|
|
1157
|
+
{ name: "--method", value: "random|ordered", description: "Seeded group ordering or source order (default random)" },
|
|
1158
|
+
{ name: "--group-by", value: "field", description: "Group field, with dotted paths supported; defaults to normalized user prompt" },
|
|
1159
|
+
{ name: "--stratify-by", value: "field", description: "Keep similar ratios within each label/category" },
|
|
1160
|
+
{ name: "--dry-run", description: "Show planned counts without writing files" }
|
|
1161
|
+
],
|
|
1162
|
+
minPositionals: 1,
|
|
1163
|
+
maxPositionals: 1
|
|
1164
|
+
},
|
|
1137
1165
|
prefetch: {
|
|
1138
1166
|
usage: "tt datasets prefetch [tunedtensor.json] [--repo org/name --training path [--test path]] [options]",
|
|
1139
1167
|
description: "Download dataset_prebuilt.huggingface files and pin them in tunedtensor.lock.json, or download any dataset files with --repo. Resumes after interruption.",
|
|
@@ -2026,6 +2054,22 @@ ${validation.errors.join("\n")}`);
|
|
|
2026
2054
|
}
|
|
2027
2055
|
if (command === "datasets") {
|
|
2028
2056
|
const subcommand = cli.subcommand;
|
|
2057
|
+
if (subcommand === "inspect") return printJson(await inspectDatasetFile(cwd(), cli.positionals[0]));
|
|
2058
|
+
if (subcommand === "split") {
|
|
2059
|
+
const numeric = (name, fallback) => readOption(argv, name) === void 0 ? fallback : Number(readOption(argv, name));
|
|
2060
|
+
const prepared = await prepareDatasetSplit(cwd(), {
|
|
2061
|
+
file: cli.positionals[0],
|
|
2062
|
+
output: readOption(argv, "--output"),
|
|
2063
|
+
train: numeric("--train", 0.8),
|
|
2064
|
+
validation: numeric("--validation", 0.1),
|
|
2065
|
+
test: numeric("--test", 0.1),
|
|
2066
|
+
seed: readOption(argv, "--seed") ?? "42",
|
|
2067
|
+
method: readOption(argv, "--method") ?? "random",
|
|
2068
|
+
group_by: readOption(argv, "--group-by"),
|
|
2069
|
+
stratify_by: readOption(argv, "--stratify-by")
|
|
2070
|
+
});
|
|
2071
|
+
return printJson(hasFlag(argv, "--dry-run") ? prepared.preview : await executeDatasetSplit(cwd(), prepared));
|
|
2072
|
+
}
|
|
2029
2073
|
const inputPath = resolve3(cli.positionals[0] ?? DEFAULT_LOCAL_SPEC_PATH);
|
|
2030
2074
|
const config = readOption(argv, "--repo") ? await resolveDownloadConfig(inputPath, readOption(argv, "--config"), (message) => console.error(message)) : await configFromArgv(argv, inputPath);
|
|
2031
2075
|
if (subcommand !== "prefetch" && subcommand !== "verify") throw new Error(`Unknown datasets command: ${subcommand}`);
|