@koda-sl/baker-cli 0.295.0-dev.f941e60fb → 0.297.0-dev.306c0952c
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.
|
@@ -2058,6 +2058,19 @@ function nearestClipDuration(model, preferred) {
|
|
|
2058
2058
|
if (!allowed?.length || allowed.includes(preferred)) return preferred;
|
|
2059
2059
|
return [...allowed].sort((a, b) => Math.abs(a - preferred) - Math.abs(b - preferred) || a - b)[0];
|
|
2060
2060
|
}
|
|
2061
|
+
function maxClipSeconds(model) {
|
|
2062
|
+
const schema = MODEL_REGISTRY.video_generate[model]?.params.duration;
|
|
2063
|
+
const allowed = schema?.kind === "number" ? schema.enum : void 0;
|
|
2064
|
+
return allowed?.length ? Math.max(...allowed) : void 0;
|
|
2065
|
+
}
|
|
2066
|
+
function splitScriptFor(words, model) {
|
|
2067
|
+
const maxSeconds = maxClipSeconds(model);
|
|
2068
|
+
if (!maxSeconds) return null;
|
|
2069
|
+
const perClip = Math.floor(maxSeconds * SPOKEN_WORDS_PER_SECOND);
|
|
2070
|
+
if (words <= perClip) return null;
|
|
2071
|
+
const clips = Math.ceil(words / perClip);
|
|
2072
|
+
return { clips, wordsPerClip: Math.ceil(words / clips), maxSeconds };
|
|
2073
|
+
}
|
|
2061
2074
|
function promptMaxLength(kind, model) {
|
|
2062
2075
|
const schema = MODEL_REGISTRY[kind]?.[model]?.params.prompt;
|
|
2063
2076
|
return schema?.kind === "string" ? schema.maxLength : void 0;
|
|
@@ -9346,6 +9359,7 @@ export {
|
|
|
9346
9359
|
SPOKEN_WORDS_PER_SECOND,
|
|
9347
9360
|
spokenWordsIn,
|
|
9348
9361
|
nearestClipDuration,
|
|
9362
|
+
splitScriptFor,
|
|
9349
9363
|
promptMaxLength,
|
|
9350
9364
|
maxInputSlot,
|
|
9351
9365
|
maxInputReferences,
|
|
@@ -9390,4 +9404,4 @@ export {
|
|
|
9390
9404
|
defaultRegistry,
|
|
9391
9405
|
createEngineFromEnv
|
|
9392
9406
|
};
|
|
9393
|
-
//# sourceMappingURL=chunk-
|
|
9407
|
+
//# sourceMappingURL=chunk-YMHERSTK.js.map
|