@tuned-tensor/cli 0.26.2 → 0.28.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 +28 -2
- package/dist/{chunk-VQWJ2XKR.js → chunk-7CO5DBCY.js} +448 -123
- package/dist/chunk-7CO5DBCY.js.map +1 -0
- package/dist/{chunk-2AIP63QO.js → chunk-FSVTMX4L.js} +13 -7
- package/dist/chunk-FSVTMX4L.js.map +1 -0
- package/dist/index.js +482 -248
- package/dist/index.js.map +1 -1
- package/dist/local-runtime.js +22 -9
- package/dist/local-runtime.js.map +1 -1
- package/dist/{prefetch-B6I7B4LR.js → prefetch-LBIOO7ZO.js} +2 -2
- package/docs/local-runtime/decision.md +2 -1
- package/docs/local-runtime/hosting.md +121 -0
- package/docs/windows.md +151 -0
- package/package.json +3 -1
- package/training/serving/uv.lock +3 -3
- package/dist/chunk-2AIP63QO.js.map +0 -1
- package/dist/chunk-VQWJ2XKR.js.map +0 -1
- /package/dist/{prefetch-B6I7B4LR.js.map → prefetch-LBIOO7ZO.js.map} +0 -0
package/dist/local-runtime.js
CHANGED
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
validateLocalFineTuneInput,
|
|
57
57
|
validateLocalPipeline,
|
|
58
58
|
writePrivateJsonAtomic
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-7CO5DBCY.js";
|
|
60
60
|
import {
|
|
61
61
|
applySpecLock,
|
|
62
62
|
assertArtifactManifest,
|
|
@@ -97,6 +97,7 @@ import {
|
|
|
97
97
|
localBehaviorSpecFileSchema,
|
|
98
98
|
localDecisionSpecFileSchema,
|
|
99
99
|
localFoundationSpecFileSchema,
|
|
100
|
+
localModelArtifactPath,
|
|
100
101
|
localRunnerConfigSchema,
|
|
101
102
|
localRuntimePackageRoot,
|
|
102
103
|
minimalMachineLearningEnvironment,
|
|
@@ -125,7 +126,7 @@ import {
|
|
|
125
126
|
withOfflineHuggingFaceCacheEnvironment,
|
|
126
127
|
withProgressHeartbeat,
|
|
127
128
|
writeSpecLockEntry
|
|
128
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-FSVTMX4L.js";
|
|
129
130
|
|
|
130
131
|
// src/local-runtime/index.ts
|
|
131
132
|
import { readFileSync as readFileSync3, realpathSync } from "fs";
|
|
@@ -133,7 +134,7 @@ import { createHash as createHash2 } from "crypto";
|
|
|
133
134
|
import { readFile as readFile2, stat } from "fs/promises";
|
|
134
135
|
import { basename, dirname, join as join5, relative, resolve as resolve3 } from "path";
|
|
135
136
|
import { cwd } from "process";
|
|
136
|
-
import { fileURLToPath
|
|
137
|
+
import { fileURLToPath } from "url";
|
|
137
138
|
|
|
138
139
|
// src/local-runtime/compare.ts
|
|
139
140
|
function byPrompt(report) {
|
|
@@ -586,8 +587,7 @@ async function runDoctor(config, request, foundationSpec) {
|
|
|
586
587
|
// src/local-runtime/model-server.ts
|
|
587
588
|
import { readFileSync as readFileSync2, statSync } from "fs";
|
|
588
589
|
import { spawn as spawn2 } from "child_process";
|
|
589
|
-
import { resolve as resolve2, join as join3 } from "path";
|
|
590
|
-
import { fileURLToPath } from "url";
|
|
590
|
+
import { isAbsolute, resolve as resolve2, join as join3 } from "path";
|
|
591
591
|
|
|
592
592
|
// src/local-runtime/serving-runtime.ts
|
|
593
593
|
import { createHash } from "crypto";
|
|
@@ -622,11 +622,10 @@ function withServingPythonEnvironment(env) {
|
|
|
622
622
|
|
|
623
623
|
// src/local-runtime/model-server.ts
|
|
624
624
|
function localArtifactPath(uri) {
|
|
625
|
-
if (uri.startsWith("file://"))
|
|
626
|
-
if (/^[a-z][a-z0-9+.-]*:/i.test(uri)) {
|
|
625
|
+
if (!uri.startsWith("file://") && !isAbsolute(uri) && /^[a-z][a-z0-9+.-]*:/i.test(uri)) {
|
|
627
626
|
throw new Error(`Local TT serving requires a local file artifact, got: ${uri}`);
|
|
628
627
|
}
|
|
629
|
-
return
|
|
628
|
+
return localModelArtifactPath(uri);
|
|
630
629
|
}
|
|
631
630
|
function boundedNumber(name, value, minimum, maximum, integer = false) {
|
|
632
631
|
if (!Number.isFinite(value) || value < minimum || value > maximum || integer && !Number.isInteger(value)) {
|
|
@@ -923,7 +922,21 @@ async function rollbackActiveModel(store) {
|
|
|
923
922
|
});
|
|
924
923
|
}
|
|
925
924
|
|
|
925
|
+
// src/local-runtime/parent-signals.ts
|
|
926
|
+
function listenForParentSignals() {
|
|
927
|
+
if (process.platform !== "win32" || process.env.TT_PARENT_IPC !== "1" || !process.channel) return;
|
|
928
|
+
process.on("message", (message) => {
|
|
929
|
+
if (!message || typeof message !== "object" || !("ttSignal" in message)) return;
|
|
930
|
+
if (message.ttSignal === "SIGINT" || message.ttSignal === "SIGTERM") process.emit(message.ttSignal);
|
|
931
|
+
});
|
|
932
|
+
process.once("disconnect", () => {
|
|
933
|
+
if (!process.emit("SIGTERM")) process.exit(143);
|
|
934
|
+
});
|
|
935
|
+
process.channel.unref();
|
|
936
|
+
}
|
|
937
|
+
|
|
926
938
|
// src/local-runtime/index.ts
|
|
939
|
+
listenForParentSignals();
|
|
927
940
|
function packageVersion() {
|
|
928
941
|
try {
|
|
929
942
|
const packageJson = JSON.parse(
|
|
@@ -2222,7 +2235,7 @@ ${validation.errors.join("\n")}`);
|
|
|
2222
2235
|
}
|
|
2223
2236
|
function isCliEntrypoint() {
|
|
2224
2237
|
if (!process.argv[1]) return false;
|
|
2225
|
-
return realpathSync(
|
|
2238
|
+
return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
|
|
2226
2239
|
}
|
|
2227
2240
|
if (isCliEntrypoint()) {
|
|
2228
2241
|
main(process.argv).catch((error) => {
|