mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-04-27 19:52:14 +00:00
Docs: Update benchmark for z-ai/glm-5.1
This commit is contained in:
14
tests/9_stream_visualizer/outputs/z-ai_glm-5.1.js
Normal file
14
tests/9_stream_visualizer/outputs/z-ai_glm-5.1.js
Normal file
@@ -0,0 +1,14 @@
|
||||
async function createStreamVisualizer(s, {maxPoints: m, alpha: a, width: w, height: h, yDomain: [y0, y1]}) {
|
||||
const {scaleLinear, line} = await import("https://cdn.jsdelivr.net/npm/d3@7/+esm")
|
||||
let d = [], e
|
||||
for await (const {timestamp: t, value: v} of s) {
|
||||
d.push({timestamp: t, value: v, ema: e = d.length ? a * v + (1 - a) * e : v})
|
||||
if (d.length > m) d.shift()
|
||||
}
|
||||
const x = scaleLinear([d[0].timestamp, d.at(-1).timestamp], [0, w]),
|
||||
y = scaleLinear([y0, y1], [h, 0])
|
||||
return {data: d, path: line().x(p => x(p.timestamp)).y(p => y(p.ema))(d)}
|
||||
}
|
||||
export default createStreamVisualizer;
|
||||
// Generation time: 93.516s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user