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

Function quantizeInt8

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

Source from the content-addressed store, hash-verified

116}
117
118function quantizeInt8(embedding) {
119 const maxVal = Math.max(...embedding.map(Math.abs));
120 return embedding.map(v => Math.round(v / maxVal * 127));
121}
122
123async function benchmarkModel(modelName, dims) {
124 console.log(`\n${'='.repeat(60)}`);

Callers 1

benchmarkModelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected