Spaces:
Running
Running
Download benchmark_cli.js from Hugdrigo/modelops-research-lab: direct link, hf CLI and curl.
- Browser
- Download file 954 Bytes
-
https://huggingface.co/spaces/Hugdrigo/modelops-research-lab/resolve/main/benchmark_cli.js
- Command line
-
hf download hf://spaces/Hugdrigo/modelops-research-lab/benchmark_cli.js
-
curl -L -o benchmark_cli.js https://huggingface.co/spaces/Hugdrigo/modelops-research-lab/resolve/main/benchmark_cli.js
954 Bytes
| // Recompute the entire benchmark without a browser: node benchmark_cli.js | |
| const fs=require('node:fs'),path=require('node:path'),E=require('./engine.js'); | |
| const read=n=>JSON.parse(fs.readFileSync(path.join(__dirname,n),'utf8')); | |
| const training=read('train.json');const bundle=E.train(training); | |
| const splits=[['Controlled IID','iid_test.json'],['Novel-pattern challenge','challenge.json']]; | |
| console.log('ModelOps Research Lab v'+E.version()+' | 842 synthetic-curated training rows'); | |
| for(const [split,file] of splits){console.log('\n'+split);const rows=read(file);const audit=E.audit(training,rows);console.log('Integrity:',JSON.stringify(audit));if(!audit.clean)throw Error('Split integrity failure');for(const method of ['nb','word','char','hybrid']){const p=E.evaluate(bundle,rows,method);const m=E.evaluation(p);console.log(method.padEnd(10), 'n='+m.n, 'Accuracy='+Math.round(m.accuracy*1000)/10+'%', 'MacroF1='+Math.round(m.macroF1*1000)/10+'%');}} | |