event 565 solution
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
diff --git a/tests/acceptance/7/CRITERIA.json b/tests/acceptance/7/CRITERIA.json
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..4e2dbaa28b6ee66b629a86874cfbbb6070cfae75
|
||||
--- /dev/null
|
||||
+++ b/tests/acceptance/7/CRITERIA.json
|
||||
@@ -0,0 +1,12 @@
|
||||
+{
|
||||
+ "schema": "elffuss-t2t/criteria@2",
|
||||
+ "issue": 7,
|
||||
+ "criteria": [
|
||||
+ {
|
||||
+ "index": 1,
|
||||
+ "tests": [
|
||||
+ "tests/acceptance/7/criteria.test.js::criterion 1"
|
||||
+ ]
|
||||
+ }
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/tests/acceptance/7/criteria.test.js b/tests/acceptance/7/criteria.test.js
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..397508f6eb720b197edbc322b08a07224abc1f1f
|
||||
--- /dev/null
|
||||
+++ b/tests/acceptance/7/criteria.test.js
|
||||
@@ -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');
|
||||
+})
|
||||
diff --git a/web/js/lab.js b/web/js/lab.js
|
||||
index b42c64109c68f5d95209e6f2eb7ba3847099e7ad..bc784c55b9bf12059d8fd21ea54693a99696cdf5 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', 'WebGPU.'],
|
||||
+ ['litert:gemma-e4b', 'Gemma-4 E4B', 'WebGPU. El mejor.'],
|
||||
];
|
||||
|
||||
// ─────────────────────────── consola ───────────────────────────
|
||||
1
events/0000000565.json
Normal file
1
events/0000000565.json
Normal file
@@ -0,0 +1 @@
|
||||
{"data":{"cites":[],"envelope":{"delegation":{"identity":"0x082ae053d1230072f2fc61d3e9aa22ff017b9f30","nonce":"1790928362","project":"0x0000000000000000000000000000000000000000000000000000000000000000","scopes":3,"sessionX":"0x6b5e37ebedb75c4a7c6a439f2d16a6c6421340403002e5ca1d8615299cb4f98a","sessionY":"0xca75eecacb48bf2798cd9f8b8cd5649247dde0dfe76ccb8d0087406431e469e0","validFrom":"1790928362","validUntil":"1791533162"},"delegationSignature":"0x0de3ef7107ef0afe05d7465fc027519d4fca9940765473a5f20d594c0f441b3341db92b69dc86c68b3690b31c18c7b46c1499ef2752d8aca9e2a3b17d8c5d64b1c","kind":"session","signature":"0x08b3d6a162f60123659862485829e712d05fb254ae1d3022c047b9c054d1dad52af33f399c3d4263c31505512cbaf39605af51b721a5a6b5241332eeaa7f8ff8"},"mainHead":null,"message":{"author":"0x082ae053d1230072f2fc61d3e9aa22ff017b9f30","baseCommit":"0x42a4a9a67cda0da050ec0e73e6294537cce1e541","basePartial":"0x0000000000000000000000000000000000000000000000000000000000000000","citesHash":"0x0000000000000000000000000000000000000000000000000000000000000000","issueId":"0x7bf84a053d2bd6ce83a7ce9d2799aadf280de622b31dbf03026d0e69d76d3a9a","issuedAt":"1790931155","lines":4,"nonce":"1790931155000","patchHash":"0x195a470c769be8b6dcf3239a1b55a2135b0812753bf6de9bcc28570eb976861e","project":"0x16d6e75341c5f21003a4d9e89b416a545f7335094d7df139fd20942c9b7fb2de","repo":"0xd822e541c0173492ca0725a08935bcd8eaa756a9559600a9427d0daac625ead2"},"pr":"elffuss/code:item/0x1e3a862541823407dd86e8209f24811df1793b6f8297cc3df0de9b1595875973"},"eventHash":"0x43936e741457fb446878deeb82bb18bbcc1c5449e29916e3ca84f3b5b782a925","gatewaySignature":"0xed19491a796c4c5dc28c128d78e2f23f1a5adf0b8b3dc2a5b9b1e87987a01b943cfadfd51eccde8f6e7713612652f24d5787c76fe6a5a6a5fd50f814c5fc005c1c","prev":"0x017a129ce9464ba44b582b4cfd7eabd0968208c23a5aeeaca1caaa16ce5717af","seq":565,"ts":1790931156,"type":"solution","v":2}
|
||||
Reference in New Issue
Block a user