jev-web 0.3.1 → 0.3.3
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/LICENSE +21 -0
- package/README.md +201 -201
- package/package.json +55 -47
- package/src/answers.mjs +36 -36
- package/src/config.mjs +65 -65
- package/src/encode.mjs +83 -83
- package/src/index.mjs +42 -42
- package/src/laya.mjs +625 -625
- package/src/questions.mjs +39 -39
- package/src/registry.mjs +102 -102
- package/src/session.mjs +151 -151
package/src/config.mjs
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
// jev-web — model defaults, backend resolution, and model-side config.
|
|
2
|
-
//
|
|
3
|
-
// Defaults point at the reference ONNX export of com-kotobalabs/open-jev-
|
|
4
|
-
// deberta-v3-large (Apache-2.0), pinned by revision for reproducibility. Any
|
|
5
|
-
// repo with the same typed-decision graph layout works: pass `model` and
|
|
6
|
-
// optionally `revision`.
|
|
7
|
-
|
|
8
|
-
export const DEFAULT_MODEL = "onnx-community/open-jev-deberta-v3-large-ONNX";
|
|
9
|
-
export const DEFAULT_REVISION = "7c79f25b5ac496089f448a969c801872ad59d31c";
|
|
10
|
-
export const DEFAULT_TEMPERATURE = 1.05;
|
|
11
|
-
export const DEFAULT_MARKERS = ["[STATE]", "[Q]", "[OPT]"];
|
|
12
|
-
export const DEFAULT_MAX_STATE_TOKENS = 256;
|
|
13
|
-
export const DEFAULT_MAX_LEN = 512;
|
|
14
|
-
|
|
15
|
-
const HF_BASE = "https://huggingface.co";
|
|
16
|
-
|
|
17
|
-
export function resolveDevice({ device = "auto", webgpu = false } = {}) {
|
|
18
|
-
if (device && device !== "auto") return device;
|
|
19
|
-
return webgpu ? "webgpu" : "wasm";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Quantized WebGPU kernels are f16-friendly (q4f16); WASM wants the
|
|
23
|
-
// non-f16 q4 build. fp32/fp16/q8 stay explicit opt-ins.
|
|
24
|
-
export function resolveDtype(device, dtype = "auto") {
|
|
25
|
-
if (dtype && dtype !== "auto") return dtype;
|
|
26
|
-
return device === "webgpu" ? "q4f16" : "q4";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function detectWebGPU(scope = globalThis) {
|
|
30
|
-
try {
|
|
31
|
-
if (!scope?.navigator?.gpu?.requestAdapter) return false;
|
|
32
|
-
return !!(await scope.navigator.gpu.requestAdapter());
|
|
33
|
-
} catch {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Read the model's own calibration/marker config when the repo ships one
|
|
39
|
-
// (open_jev_config.json), else fall back to the published reference values.
|
|
40
|
-
export async function loadModelConfig({ model = DEFAULT_MODEL, revision = DEFAULT_REVISION, fetchImpl = fetch } = {}) {
|
|
41
|
-
const fallback = {
|
|
42
|
-
temperature: DEFAULT_TEMPERATURE,
|
|
43
|
-
markers: [...DEFAULT_MARKERS],
|
|
44
|
-
maxStateTokens: DEFAULT_MAX_STATE_TOKENS,
|
|
45
|
-
maxLen: DEFAULT_MAX_LEN,
|
|
46
|
-
pool: "span",
|
|
47
|
-
source: "defaults",
|
|
48
|
-
};
|
|
49
|
-
const url = `${HF_BASE}/${model}/resolve/${revision ? `${revision}/` : ""}open_jev_config.json`;
|
|
50
|
-
try {
|
|
51
|
-
const res = await fetchImpl(url, { cache: "no-store" });
|
|
52
|
-
if (!res.ok) return fallback;
|
|
53
|
-
const cfg = await res.json();
|
|
54
|
-
return {
|
|
55
|
-
temperature: Number.isFinite(Number(cfg.temperature)) ? Number(cfg.temperature) : fallback.temperature,
|
|
56
|
-
markers: Array.isArray(cfg.markers) && cfg.markers.length === 3 ? cfg.markers.map(String) : fallback.markers,
|
|
57
|
-
maxStateTokens: Number.isFinite(Number(cfg.max_state_tokens)) ? Number(cfg.max_state_tokens) : fallback.maxStateTokens,
|
|
58
|
-
maxLen: Number.isFinite(Number(cfg.max_len)) ? Number(cfg.max_len) : fallback.maxLen,
|
|
59
|
-
pool: typeof cfg.pool === "string" ? cfg.pool : fallback.pool,
|
|
60
|
-
source: "model",
|
|
61
|
-
};
|
|
62
|
-
} catch {
|
|
63
|
-
return fallback;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
// jev-web — model defaults, backend resolution, and model-side config.
|
|
2
|
+
//
|
|
3
|
+
// Defaults point at the reference ONNX export of com-kotobalabs/open-jev-
|
|
4
|
+
// deberta-v3-large (Apache-2.0), pinned by revision for reproducibility. Any
|
|
5
|
+
// repo with the same typed-decision graph layout works: pass `model` and
|
|
6
|
+
// optionally `revision`.
|
|
7
|
+
|
|
8
|
+
export const DEFAULT_MODEL = "onnx-community/open-jev-deberta-v3-large-ONNX";
|
|
9
|
+
export const DEFAULT_REVISION = "7c79f25b5ac496089f448a969c801872ad59d31c";
|
|
10
|
+
export const DEFAULT_TEMPERATURE = 1.05;
|
|
11
|
+
export const DEFAULT_MARKERS = ["[STATE]", "[Q]", "[OPT]"];
|
|
12
|
+
export const DEFAULT_MAX_STATE_TOKENS = 256;
|
|
13
|
+
export const DEFAULT_MAX_LEN = 512;
|
|
14
|
+
|
|
15
|
+
const HF_BASE = "https://huggingface.co";
|
|
16
|
+
|
|
17
|
+
export function resolveDevice({ device = "auto", webgpu = false } = {}) {
|
|
18
|
+
if (device && device !== "auto") return device;
|
|
19
|
+
return webgpu ? "webgpu" : "wasm";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Quantized WebGPU kernels are f16-friendly (q4f16); WASM wants the
|
|
23
|
+
// non-f16 q4 build. fp32/fp16/q8 stay explicit opt-ins.
|
|
24
|
+
export function resolveDtype(device, dtype = "auto") {
|
|
25
|
+
if (dtype && dtype !== "auto") return dtype;
|
|
26
|
+
return device === "webgpu" ? "q4f16" : "q4";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function detectWebGPU(scope = globalThis) {
|
|
30
|
+
try {
|
|
31
|
+
if (!scope?.navigator?.gpu?.requestAdapter) return false;
|
|
32
|
+
return !!(await scope.navigator.gpu.requestAdapter());
|
|
33
|
+
} catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Read the model's own calibration/marker config when the repo ships one
|
|
39
|
+
// (open_jev_config.json), else fall back to the published reference values.
|
|
40
|
+
export async function loadModelConfig({ model = DEFAULT_MODEL, revision = DEFAULT_REVISION, fetchImpl = fetch } = {}) {
|
|
41
|
+
const fallback = {
|
|
42
|
+
temperature: DEFAULT_TEMPERATURE,
|
|
43
|
+
markers: [...DEFAULT_MARKERS],
|
|
44
|
+
maxStateTokens: DEFAULT_MAX_STATE_TOKENS,
|
|
45
|
+
maxLen: DEFAULT_MAX_LEN,
|
|
46
|
+
pool: "span",
|
|
47
|
+
source: "defaults",
|
|
48
|
+
};
|
|
49
|
+
const url = `${HF_BASE}/${model}/resolve/${revision ? `${revision}/` : ""}open_jev_config.json`;
|
|
50
|
+
try {
|
|
51
|
+
const res = await fetchImpl(url, { cache: "no-store" });
|
|
52
|
+
if (!res.ok) return fallback;
|
|
53
|
+
const cfg = await res.json();
|
|
54
|
+
return {
|
|
55
|
+
temperature: Number.isFinite(Number(cfg.temperature)) ? Number(cfg.temperature) : fallback.temperature,
|
|
56
|
+
markers: Array.isArray(cfg.markers) && cfg.markers.length === 3 ? cfg.markers.map(String) : fallback.markers,
|
|
57
|
+
maxStateTokens: Number.isFinite(Number(cfg.max_state_tokens)) ? Number(cfg.max_state_tokens) : fallback.maxStateTokens,
|
|
58
|
+
maxLen: Number.isFinite(Number(cfg.max_len)) ? Number(cfg.max_len) : fallback.maxLen,
|
|
59
|
+
pool: typeof cfg.pool === "string" ? cfg.pool : fallback.pool,
|
|
60
|
+
source: "model",
|
|
61
|
+
};
|
|
62
|
+
} catch {
|
|
63
|
+
return fallback;
|
|
64
|
+
}
|
|
65
|
+
}
|
package/src/encode.mjs
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
// jev-web — pure input builder for open-jev-shaped models.
|
|
2
|
-
//
|
|
3
|
-
// Layout produced (mirrors the reference export):
|
|
4
|
-
// [CLS] [STATE] state [Q] instructions [OPT] option … [SEP]
|
|
5
|
-
//
|
|
6
|
-
// `seg` carries a span slot per token: option tokens get their pair index,
|
|
7
|
-
// question-instruction tokens get `totalPairs + question index`, everything
|
|
8
|
-
// else -1. `pair_q` / `pair_opt` list the question slot and pair slot for
|
|
9
|
-
// every (question, option) pair; `groups` groups pair indices per question.
|
|
10
|
-
// The ONNX graph consumes these directly (see the model's export docs).
|
|
11
|
-
|
|
12
|
-
export class DecisionInputTooLongError extends Error {
|
|
13
|
-
constructor(message) {
|
|
14
|
-
super(message);
|
|
15
|
-
this.name = "DecisionInputTooLongError";
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Runtime-independent: take pre-tokenized ids and lay out the sequence.
|
|
20
|
-
export function buildDecisionInput({
|
|
21
|
-
stateIds,
|
|
22
|
-
markers, // { cls, sep, state, question, option } single token ids
|
|
23
|
-
questions, // [{ type, instructionIds: number[], optionIds: number[][] }]
|
|
24
|
-
maxStateTokens = 256,
|
|
25
|
-
maxLen = 512,
|
|
26
|
-
}) {
|
|
27
|
-
if (!Array.isArray(stateIds)) throw new TypeError("stateIds must be an array of token ids");
|
|
28
|
-
if (!Array.isArray(questions) || questions.length === 0) {
|
|
29
|
-
throw new TypeError("questions must be a non-empty array of tokenized questions");
|
|
30
|
-
}
|
|
31
|
-
for (const key of ["cls", "sep", "state", "question", "option"]) {
|
|
32
|
-
if (!Number.isInteger(markers?.[key])) throw new TypeError(`markers.${key} must be a token id`);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const truncated = stateIds.length > maxStateTokens;
|
|
36
|
-
const state = truncated ? stateIds.slice(0, maxStateTokens) : stateIds;
|
|
37
|
-
|
|
38
|
-
const inputIds = [markers.cls, markers.state, ...state];
|
|
39
|
-
const seg = inputIds.map(() => -1);
|
|
40
|
-
const pairQ = [];
|
|
41
|
-
const pairOpt = [];
|
|
42
|
-
const groups = [];
|
|
43
|
-
const totalPairs = questions.reduce((n, q) => n + q.optionIds.length, 0);
|
|
44
|
-
|
|
45
|
-
questions.forEach((q, qi) => {
|
|
46
|
-
inputIds.push(markers.question, ...q.instructionIds);
|
|
47
|
-
seg.push(-1, ...q.instructionIds.map(() => totalPairs + qi));
|
|
48
|
-
groups.push(
|
|
49
|
-
q.optionIds.map((ids) => {
|
|
50
|
-
inputIds.push(markers.option, ...ids);
|
|
51
|
-
seg.push(-1, ...ids.map(() => pairOpt.length));
|
|
52
|
-
pairQ.push(totalPairs + qi);
|
|
53
|
-
pairOpt.push(pairOpt.length);
|
|
54
|
-
return pairOpt.length - 1;
|
|
55
|
-
}),
|
|
56
|
-
);
|
|
57
|
-
});
|
|
58
|
-
inputIds.push(markers.sep);
|
|
59
|
-
seg.push(-1);
|
|
60
|
-
|
|
61
|
-
if (inputIds.length > maxLen) {
|
|
62
|
-
throw new DecisionInputTooLongError(
|
|
63
|
-
`decision input is ${inputIds.length} tokens, over the ${maxLen}-token limit ` +
|
|
64
|
-
`(state capped at ${maxStateTokens}) — shorten the questions or the state`,
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
return { inputIds, seg, pairQ, pairOpt, groups, truncated, length: inputIds.length, totalPairs };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Shared marker lookup: every marker must encode to exactly one token id.
|
|
71
|
-
// (Custom typed-decision exports add [STATE]/[Q]/[OPT] to the tokenizer; if
|
|
72
|
-
// they are missing, the model is not a typed-decision export.)
|
|
73
|
-
export function typedMarkerIds(encodeFn, { markers = ["[STATE]", "[Q]", "[OPT]"], cls = "[CLS]", sep = "[SEP]" } = {}) {
|
|
74
|
-
const one = (text) => {
|
|
75
|
-
const ids = encodeFn(text);
|
|
76
|
-
if (!Array.isArray(ids) || ids.length !== 1) {
|
|
77
|
-
throw new Error(`marker ${text} must encode to exactly one token (got ${ids?.length ?? 0})`);
|
|
78
|
-
}
|
|
79
|
-
return ids[0];
|
|
80
|
-
};
|
|
81
|
-
const [state, question, option] = markers.map(one);
|
|
82
|
-
return { cls: one(cls), sep: one(sep), state, question, option };
|
|
83
|
-
}
|
|
1
|
+
// jev-web — pure input builder for open-jev-shaped models.
|
|
2
|
+
//
|
|
3
|
+
// Layout produced (mirrors the reference export):
|
|
4
|
+
// [CLS] [STATE] state [Q] instructions [OPT] option … [SEP]
|
|
5
|
+
//
|
|
6
|
+
// `seg` carries a span slot per token: option tokens get their pair index,
|
|
7
|
+
// question-instruction tokens get `totalPairs + question index`, everything
|
|
8
|
+
// else -1. `pair_q` / `pair_opt` list the question slot and pair slot for
|
|
9
|
+
// every (question, option) pair; `groups` groups pair indices per question.
|
|
10
|
+
// The ONNX graph consumes these directly (see the model's export docs).
|
|
11
|
+
|
|
12
|
+
export class DecisionInputTooLongError extends Error {
|
|
13
|
+
constructor(message) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = "DecisionInputTooLongError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Runtime-independent: take pre-tokenized ids and lay out the sequence.
|
|
20
|
+
export function buildDecisionInput({
|
|
21
|
+
stateIds,
|
|
22
|
+
markers, // { cls, sep, state, question, option } single token ids
|
|
23
|
+
questions, // [{ type, instructionIds: number[], optionIds: number[][] }]
|
|
24
|
+
maxStateTokens = 256,
|
|
25
|
+
maxLen = 512,
|
|
26
|
+
}) {
|
|
27
|
+
if (!Array.isArray(stateIds)) throw new TypeError("stateIds must be an array of token ids");
|
|
28
|
+
if (!Array.isArray(questions) || questions.length === 0) {
|
|
29
|
+
throw new TypeError("questions must be a non-empty array of tokenized questions");
|
|
30
|
+
}
|
|
31
|
+
for (const key of ["cls", "sep", "state", "question", "option"]) {
|
|
32
|
+
if (!Number.isInteger(markers?.[key])) throw new TypeError(`markers.${key} must be a token id`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const truncated = stateIds.length > maxStateTokens;
|
|
36
|
+
const state = truncated ? stateIds.slice(0, maxStateTokens) : stateIds;
|
|
37
|
+
|
|
38
|
+
const inputIds = [markers.cls, markers.state, ...state];
|
|
39
|
+
const seg = inputIds.map(() => -1);
|
|
40
|
+
const pairQ = [];
|
|
41
|
+
const pairOpt = [];
|
|
42
|
+
const groups = [];
|
|
43
|
+
const totalPairs = questions.reduce((n, q) => n + q.optionIds.length, 0);
|
|
44
|
+
|
|
45
|
+
questions.forEach((q, qi) => {
|
|
46
|
+
inputIds.push(markers.question, ...q.instructionIds);
|
|
47
|
+
seg.push(-1, ...q.instructionIds.map(() => totalPairs + qi));
|
|
48
|
+
groups.push(
|
|
49
|
+
q.optionIds.map((ids) => {
|
|
50
|
+
inputIds.push(markers.option, ...ids);
|
|
51
|
+
seg.push(-1, ...ids.map(() => pairOpt.length));
|
|
52
|
+
pairQ.push(totalPairs + qi);
|
|
53
|
+
pairOpt.push(pairOpt.length);
|
|
54
|
+
return pairOpt.length - 1;
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
inputIds.push(markers.sep);
|
|
59
|
+
seg.push(-1);
|
|
60
|
+
|
|
61
|
+
if (inputIds.length > maxLen) {
|
|
62
|
+
throw new DecisionInputTooLongError(
|
|
63
|
+
`decision input is ${inputIds.length} tokens, over the ${maxLen}-token limit ` +
|
|
64
|
+
`(state capped at ${maxStateTokens}) — shorten the questions or the state`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return { inputIds, seg, pairQ, pairOpt, groups, truncated, length: inputIds.length, totalPairs };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Shared marker lookup: every marker must encode to exactly one token id.
|
|
71
|
+
// (Custom typed-decision exports add [STATE]/[Q]/[OPT] to the tokenizer; if
|
|
72
|
+
// they are missing, the model is not a typed-decision export.)
|
|
73
|
+
export function typedMarkerIds(encodeFn, { markers = ["[STATE]", "[Q]", "[OPT]"], cls = "[CLS]", sep = "[SEP]" } = {}) {
|
|
74
|
+
const one = (text) => {
|
|
75
|
+
const ids = encodeFn(text);
|
|
76
|
+
if (!Array.isArray(ids) || ids.length !== 1) {
|
|
77
|
+
throw new Error(`marker ${text} must encode to exactly one token (got ${ids?.length ?? 0})`);
|
|
78
|
+
}
|
|
79
|
+
return ids[0];
|
|
80
|
+
};
|
|
81
|
+
const [state, question, option] = markers.map(one);
|
|
82
|
+
return { cls: one(cls), sep: one(sep), state, question, option };
|
|
83
|
+
}
|
package/src/index.mjs
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
// jev-web — public API (typed decisions in the browser).
|
|
2
|
-
export { createDecider } from "./session.mjs";
|
|
3
|
-
export {
|
|
4
|
-
registerDecisionFamily, createDecisionRuntime,
|
|
5
|
-
listDecisionFamilies, getDecisionFamily,
|
|
6
|
-
} from "./registry.mjs";
|
|
7
|
-
export { normalizeQuestions, QUESTION_TYPES, NOUL_OPTIONS } from "./questions.mjs";
|
|
8
|
-
export { buildDecisionInput, typedMarkerIds, DecisionInputTooLongError } from "./encode.mjs";
|
|
9
|
-
export { answersFromScores, softmaxWithTemperature } from "./answers.mjs";
|
|
10
|
-
export {
|
|
11
|
-
createLayaDecider,
|
|
12
|
-
buildLayaSequence,
|
|
13
|
-
collateLayaItems,
|
|
14
|
-
layaAnswersFromLogits,
|
|
15
|
-
layaTokenizerAdapter,
|
|
16
|
-
renderLayaOptions,
|
|
17
|
-
layaTempBucket,
|
|
18
|
-
clampTemperature,
|
|
19
|
-
LAYA_DEFAULT_MODEL,
|
|
20
|
-
LAYA_DEFAULT_REVISION,
|
|
21
|
-
LAYA_DEFAULT_SUBFOLDER,
|
|
22
|
-
LAYA_DEFAULT_TEMPERATURES,
|
|
23
|
-
LAYA_DEFAULT_TEMPERATURES_BY_OPTIONS,
|
|
24
|
-
LAYA_DEFAULT_MAX_LEN,
|
|
25
|
-
LAYA_DEFAULT_HEAD_MAX_LEN,
|
|
26
|
-
LAYA_DEFAULT_MAX_PREFIXES,
|
|
27
|
-
LAYA_QTYPE,
|
|
28
|
-
LAYA_TEMP_MIN,
|
|
29
|
-
LAYA_TEMP_MAX,
|
|
30
|
-
} from "./laya.mjs";
|
|
31
|
-
export {
|
|
32
|
-
DEFAULT_MODEL,
|
|
33
|
-
DEFAULT_REVISION,
|
|
34
|
-
DEFAULT_TEMPERATURE,
|
|
35
|
-
DEFAULT_MARKERS,
|
|
36
|
-
DEFAULT_MAX_STATE_TOKENS,
|
|
37
|
-
DEFAULT_MAX_LEN,
|
|
38
|
-
resolveDevice,
|
|
39
|
-
resolveDtype,
|
|
40
|
-
detectWebGPU,
|
|
41
|
-
loadModelConfig,
|
|
42
|
-
} from "./config.mjs";
|
|
1
|
+
// jev-web — public API (typed decisions in the browser).
|
|
2
|
+
export { createDecider } from "./session.mjs";
|
|
3
|
+
export {
|
|
4
|
+
registerDecisionFamily, createDecisionRuntime,
|
|
5
|
+
listDecisionFamilies, getDecisionFamily,
|
|
6
|
+
} from "./registry.mjs";
|
|
7
|
+
export { normalizeQuestions, QUESTION_TYPES, NOUL_OPTIONS } from "./questions.mjs";
|
|
8
|
+
export { buildDecisionInput, typedMarkerIds, DecisionInputTooLongError } from "./encode.mjs";
|
|
9
|
+
export { answersFromScores, softmaxWithTemperature } from "./answers.mjs";
|
|
10
|
+
export {
|
|
11
|
+
createLayaDecider,
|
|
12
|
+
buildLayaSequence,
|
|
13
|
+
collateLayaItems,
|
|
14
|
+
layaAnswersFromLogits,
|
|
15
|
+
layaTokenizerAdapter,
|
|
16
|
+
renderLayaOptions,
|
|
17
|
+
layaTempBucket,
|
|
18
|
+
clampTemperature,
|
|
19
|
+
LAYA_DEFAULT_MODEL,
|
|
20
|
+
LAYA_DEFAULT_REVISION,
|
|
21
|
+
LAYA_DEFAULT_SUBFOLDER,
|
|
22
|
+
LAYA_DEFAULT_TEMPERATURES,
|
|
23
|
+
LAYA_DEFAULT_TEMPERATURES_BY_OPTIONS,
|
|
24
|
+
LAYA_DEFAULT_MAX_LEN,
|
|
25
|
+
LAYA_DEFAULT_HEAD_MAX_LEN,
|
|
26
|
+
LAYA_DEFAULT_MAX_PREFIXES,
|
|
27
|
+
LAYA_QTYPE,
|
|
28
|
+
LAYA_TEMP_MIN,
|
|
29
|
+
LAYA_TEMP_MAX,
|
|
30
|
+
} from "./laya.mjs";
|
|
31
|
+
export {
|
|
32
|
+
DEFAULT_MODEL,
|
|
33
|
+
DEFAULT_REVISION,
|
|
34
|
+
DEFAULT_TEMPERATURE,
|
|
35
|
+
DEFAULT_MARKERS,
|
|
36
|
+
DEFAULT_MAX_STATE_TOKENS,
|
|
37
|
+
DEFAULT_MAX_LEN,
|
|
38
|
+
resolveDevice,
|
|
39
|
+
resolveDtype,
|
|
40
|
+
detectWebGPU,
|
|
41
|
+
loadModelConfig,
|
|
42
|
+
} from "./config.mjs";
|