@tuned-tensor/cli 0.24.0 → 0.25.0
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 +90 -5
- package/dist/{chunk-RPWOCVIL.js → chunk-7RJGLRMO.js} +750 -3131
- package/dist/chunk-7RJGLRMO.js.map +1 -0
- package/dist/chunk-UCJCWJ6F.js +2809 -0
- package/dist/chunk-UCJCWJ6F.js.map +1 -0
- package/dist/index.js +1148 -399
- package/dist/index.js.map +1 -1
- package/dist/local-runtime.js +183 -71
- package/dist/local-runtime.js.map +1 -1
- package/dist/prefetch-GP3OPUUL.js +18 -0
- package/dist/prefetch-GP3OPUUL.js.map +1 -0
- package/docs/local-runtime/architecture.md +1 -1
- package/docs/spec-workflow.md +17 -3
- package/package.json +4 -1
- package/training/adapter/src/prefetch.py +11 -5
- package/dist/chunk-RPWOCVIL.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
buildModelPrefetchPayload,
|
|
4
|
+
buildModelSourcePrefetchPayload,
|
|
5
|
+
prefetchBaseModel,
|
|
6
|
+
safeName,
|
|
7
|
+
verifyLocalBaseModel,
|
|
8
|
+
verifyModelPrefetchCacheReport
|
|
9
|
+
} from "./chunk-UCJCWJ6F.js";
|
|
10
|
+
export {
|
|
11
|
+
buildModelPrefetchPayload,
|
|
12
|
+
buildModelSourcePrefetchPayload,
|
|
13
|
+
prefetchBaseModel,
|
|
14
|
+
safeName,
|
|
15
|
+
verifyLocalBaseModel,
|
|
16
|
+
verifyModelPrefetchCacheReport
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=prefetch-GP3OPUUL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -173,7 +173,7 @@ whose stderr is a pipe.
|
|
|
173
173
|
|
|
174
174
|
Dataset runs resolve the cached snapshot in Node without network access.
|
|
175
175
|
Each split file must link into the repo's blob store, and its digest must match
|
|
176
|
-
the blob name. With `columns`, records are converted to chat rows under
|
|
176
|
+
the blob name. With `columns`, JSONL or Parquet records are converted to chat rows under
|
|
177
177
|
`<artifactRoot>/datasets/huggingface/`. The conversion path is keyed by the
|
|
178
178
|
source digests, the mapping and the system message.
|
|
179
179
|
|
package/docs/spec-workflow.md
CHANGED
|
@@ -123,12 +123,26 @@ Foundation supports `runtime.artifactRoot` and `runtime.gpu`; its evaluation
|
|
|
123
123
|
and training settings remain under `foundation`.
|
|
124
124
|
|
|
125
125
|
`dataset_prebuilt.huggingface` names a Hugging Face dataset repo, an optional
|
|
126
|
-
pinned `revision` and optional `columns` (`input`/`output` field names
|
|
127
|
-
split paths are then
|
|
128
|
-
|
|
126
|
+
pinned `revision` and optional `columns` (`input`/`output` field names, or
|
|
127
|
+
`messages` for a chat column). Its split paths are then `.jsonl` or `.parquet`
|
|
128
|
+
files inside that repo; Parquet requires `columns`. `tt datasets prefetch`
|
|
129
|
+
downloads them (the agent's `prepare_download` runs it after approval), and `tt pipeline run` downloads them automatically if they are missing.
|
|
130
|
+
`prepare_download` and `--repo` also download sources the spec does not name yet;
|
|
131
|
+
adopt them with a spec edit afterwards. Spec downloads and the first real run
|
|
132
|
+
write `tunedtensor.lock.json` beside the spec, which pins the dataset and
|
|
133
|
+
base-model commit and file digests; later runs stop when they disagree with it.
|
|
129
134
|
Runs record the resolved commit and file digests in the report. See the README
|
|
130
135
|
section "Train on a Hugging Face dataset".
|
|
131
136
|
|
|
137
|
+
In the agent, ask which datasets are downloaded, then ask to use one in the
|
|
138
|
+
spec. `list_local_datasets` finds TT's local download records;
|
|
139
|
+
`inspect_local_dataset` reads actual cached columns and a bounded sample.
|
|
140
|
+
The agent can then prepare a `dataset_prebuilt` edit with the exact revision,
|
|
141
|
+
training and held-out filenames, and column mapping, without asking you to
|
|
142
|
+
paste a manifest or run a schema command. The edit still requires approval.
|
|
143
|
+
Inline examples remain in the spec but are not automatically added to prebuilt
|
|
144
|
+
training data. A training-only download needs a distinct evaluation split.
|
|
145
|
+
|
|
132
146
|
Only `tunedtensor.json` is required. `tt pipeline init --spec tunedtensor.json`
|
|
133
147
|
embeds an advanced recipe when needed; omit this step to keep automatic derivation.
|
|
134
148
|
An explicit `--file` cannot override a conflicting embedded recipe.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuned-tensor/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Local TT agent and CUDA fine-tuning CLI for Tuned Tensor workflows",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -62,6 +62,8 @@
|
|
|
62
62
|
"chalk": "^6.0.0",
|
|
63
63
|
"cli-table3": "^0.6.5",
|
|
64
64
|
"commander": "^15.0.0",
|
|
65
|
+
"hyparquet": "1.31.4",
|
|
66
|
+
"hyparquet-compressors": "1.1.2",
|
|
65
67
|
"open": "^10.1.0",
|
|
66
68
|
"ora": "^9.3.0",
|
|
67
69
|
"typebox": "1.3.27",
|
|
@@ -69,6 +71,7 @@
|
|
|
69
71
|
},
|
|
70
72
|
"devDependencies": {
|
|
71
73
|
"@types/node": "^25.3.5",
|
|
74
|
+
"hyparquet-writer": "0.16.12",
|
|
72
75
|
"tsup": "^8.5.1",
|
|
73
76
|
"tsx": "^4.23.12",
|
|
74
77
|
"typescript": "^5.9.3",
|
|
@@ -137,6 +137,16 @@ def verify_snapshot(snapshot: Path, expected_model_id: str | None = None) -> tup
|
|
|
137
137
|
return files, verified_blobs
|
|
138
138
|
|
|
139
139
|
|
|
140
|
+
def check_requested_revision(base_model: str, revision: str | None, resolve_latest: bool) -> None:
|
|
141
|
+
"""Certified models keep their reviewed revision. An uncertified model needs
|
|
142
|
+
a pinned commit, except for a direct download that resolves its latest
|
|
143
|
+
commit (`tt models prefetch --repo`); the resolved SHA is reported so the
|
|
144
|
+
spec can pin it."""
|
|
145
|
+
if resolve_latest and revision is None and not is_certified_base_model(base_model):
|
|
146
|
+
return
|
|
147
|
+
assert_certified_base_model_revision(base_model, revision, "Prefetch base model revision")
|
|
148
|
+
|
|
149
|
+
|
|
140
150
|
def main() -> None:
|
|
141
151
|
parser = argparse.ArgumentParser(description="Prefetch a TT Hugging Face base model for local use.")
|
|
142
152
|
parser.add_argument("--input", required=True)
|
|
@@ -147,11 +157,7 @@ def main() -> None:
|
|
|
147
157
|
base_model = str(payload["base_model"])
|
|
148
158
|
assert_certified_base_model(base_model, "Prefetch base model")
|
|
149
159
|
requested_revision = payload.get("revision")
|
|
150
|
-
|
|
151
|
-
base_model,
|
|
152
|
-
requested_revision,
|
|
153
|
-
"Prefetch base model revision",
|
|
154
|
-
)
|
|
160
|
+
check_requested_revision(base_model, requested_revision, bool(payload.get("resolve_latest")))
|
|
155
161
|
cache_dir = payload.get("model_cache")
|
|
156
162
|
configure_hugging_face_cache(cache_dir)
|
|
157
163
|
|