MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / main

Function main

implementations/browser/embedding-bench.mjs:218–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216
217// --- Main ---
218async function main() {
219 console.log('TMP Embedding Benchmark — Node.js / @huggingface/transformers');
220 console.log(`Runtime: Node.js ${process.version}`);
221 console.log(`Platform: ${process.platform} ${process.arch}`);
222 console.log('');
223
224 const results = [];
225 for (const model of MODELS) {
226 const result = await benchmarkModel(model.name, model.dims);
227 results.push(result);
228 }
229
230 console.log(`\n${'='.repeat(60)}`);
231 console.log('SUMMARY');
232 console.log('='.repeat(60));
233 console.log('');
234 console.log('Model'.padEnd(30) + 'Accuracy'.padEnd(12) + 'Latency'.padEnd(10) + 'Wire');
235 console.log('-'.repeat(62));
236 for (const r of results) {
237 console.log(
238 `${r.modelName.padEnd(30)}${r.accuracy.padEnd(12)}${r.avgLatency.padEnd(10)}${r.dims}B`
239 );
240 }
241
242 console.log(`\nRecommendation: ${results.sort((a, b) => b.correct - a.correct)[0].modelName}`);
243}
244
245main().catch(console.error);

Callers 1

Calls 1

benchmarkModelFunction · 0.85

Tested by

no test coverage detected