Compare commits
1 Commits
main
...
item/0xb53
| Author | SHA1 | Date | |
|---|---|---|---|
| 2d1f524dd3 |
12
tests/acceptance/7/CRITERIA.json
Normal file
12
tests/acceptance/7/CRITERIA.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"schema": "elffuss-t2t/criteria@2",
|
||||
"issue": 7,
|
||||
"criteria": [
|
||||
{
|
||||
"index": 1,
|
||||
"tests": [
|
||||
"tests/acceptance/7/criteria.test.js::criterion 1"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
26
tests/acceptance/7/criteria.test.js
Normal file
26
tests/acceptance/7/criteria.test.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { test } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import * as mod from '../../../web/js/lab.js' // the code under test: call it as mod.<name>(...)
|
||||
const 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
|
||||
|
||||
test('criterion 1', () => {
|
||||
// The label of each `litert:<key>` entry of `BRAINS` equals the `label` of `MODELS[<key>]` from providers/litert.js, and the entries `rules` and `onnx` still come first with their current labels.
|
||||
const brains = mod.getBrains();
|
||||
const models = mod.getModels();
|
||||
const brainsLabels = Object.entries(brains).map(([key, brain]) => brain.label);
|
||||
const modelsLabels = Object.entries(models).map(([key, model]) => model.label);
|
||||
|
||||
for (const [key, brain] of Object.entries(brains)) {
|
||||
assert.equal(brain.label, models[key].label, `Label mismatch for key: ${key}`);
|
||||
}
|
||||
|
||||
const brainKeys = Object.keys(brains);
|
||||
const modelKeys = Object.keys(models);
|
||||
|
||||
const rulesIndex = brainKeys.indexOf('rules');
|
||||
const onnxIndex = brainKeys.indexOf('onnx');
|
||||
|
||||
assert.equal(rulesIndex, 0, 'rules should be the first entry in BRAINS');
|
||||
assert.equal(onnxIndex, 1, 'onnx should be the second entry in BRAINS');
|
||||
})
|
||||
@@ -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', 'WebGPU.'],
|
||||
['litert:gemma-e4b', 'Gemma-4 E4B', 'WebGPU. El mejor.'],
|
||||
];
|
||||
|
||||
// ─────────────────────────── consola ───────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user