24 lines
2.6 KiB
Plaintext
24 lines
2.6 KiB
Plaintext
diff --git a/tests/acceptance/1/criteria.test.js b/tests/acceptance/1/criteria.test.js
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..df9f30c5f42fd5d06cc8958f913a692290c10bc5
|
|
--- /dev/null
|
|
+++ b/tests/acceptance/1/criteria.test.js
|
|
@@ -0,0 +1 @@
|
|
+import { test } from 'node:test'\nimport assert from 'node:assert/strict'\nimport { readFileSync } from 'node:fs'\nimport * as mod from '../../../web/js/lab.js' // the code under test: call it as mod.<name>(...)\nconst source = readFileSync(new URL('../../../web/js/lab.js', import.meta.url), 'utf8') // the text of web/js/lab.js, for a criterion about how the file is written\n\ntest('criterion 1', () => {\n // Every `litert:<key>` entry of `BRAINS` has a `<key>` that is a key of `MODELS` from providers/litert.js.\n const brains = mod.getBrains();\n const models = mod.getModels();\n for (const brain of brains) {\n if (brain.type === 'litert') {\n const key = brain.key;\n assert.ok(models.hasOwnProperty(key), `Key ${key} in BRAINS is not in MODELS`);\n }\n }\n})\n\ntest('criterion 2', () => {\n // The label of each `litert:<key>` entry of `BRAINS` equals the `label` of `MODELS[<key>]`.\n const brains = mod.getBrains();\n const models = mod.getModels();\n for (const brain of brains) {\n if (brain.type === 'litert') {\n const key = brain.key;\n assert.equal(brain.label, models[key].label, `Label mismatch for key ${key}`);\n }\n }\n})\n\ntest('criterion 3', () => {\n // The `BRAINS` list still contains the entries `rules` and `onnx` unchanged.\n const brains = mod.getBrains();\n const hasRules = brains.some(b => b.key === 'rules');\n const hasOnnx = brains.some(b => b.key === 'onnx');\n assert.ok(hasRules, 'BRAINS list does not contain "rules"');\n assert.ok(hasOnnx, 'BRAINS list does not contain "onnx"');\n})\n
|
|
\ No newline at end of file
|
|
diff --git a/web/js/lab.js b/web/js/lab.js
|
|
index b42c64109c68f5d95209e6f2eb7ba3847099e7ad..84264604b0bd0d50488354fbd5caf554a5c88f11 100644
|
|
--- a/web/js/lab.js
|
|
+++ b/web/js/lab.js
|
|
@@ -68,8 +68,8 @@ const BENCHES = [
|
|
const BRAINS = [
|
|
['rules', 'Reglas (sin GPU)', 'Determinista. Valida el arnés sin bajar pesos.'],
|
|
['onnx', 'Elffuss LM (CPU/wasm)', 'LFM2.5-1.2B por transformers.js.'],
|
|
- ['litert:gemma-e2b', 'Gemma-4 E2B (~2 GB)', 'WebGPU.'],
|
|
- ['litert:gemma-e4b', 'Gemma-4 E4B (~3 GB)', 'WebGPU. El mejor.'],
|
|
+ ['litert:gemma-e2b', 'Gemma-4 E2B (~2 GB)', 'WebGPU.']
|
|
+ ['litert:gemma-e4b', 'Gemma-4 E4B (~4 GB)', 'WebGPU. El mejor.']
|
|
];
|
|
|
|
// ─────────────────────────── consola ───────────────────────────
|