mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark for moonshotai/kimi-k2-thinking
This commit is contained in:
19
tests/6_csv_processor/outputs/moonshotai_kimi-k2-thinking.js
Normal file
19
tests/6_csv_processor/outputs/moonshotai_kimi-k2-thinking.js
Normal file
@@ -0,0 +1,19 @@
|
||||
async function processCSV(csv, cfg) {
|
||||
const [{ default: Papa }, { default: _ }] = await Promise.all([
|
||||
import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm'),
|
||||
import('https://cdn.jsdelivr.net/npm/lodash@4.17.21/+esm')
|
||||
]);
|
||||
|
||||
const filtered = Papa.parse(csv, { header: true, dynamicTyping: true }).data
|
||||
.filter(r => r[cfg.filterColumn] == cfg.filterValue);
|
||||
|
||||
return Object.entries(_.groupBy(filtered, cfg.groupBy)).map(([k, v]) => {
|
||||
const sum = v.reduce((s, r) => s + (Number(r[cfg.aggregateColumn]) || 0), 0);
|
||||
return {
|
||||
[cfg.groupBy]: k,
|
||||
result: cfg.operation === 'count' ? v.length :
|
||||
cfg.operation === 'avg' ? sum / v.length : sum
|
||||
};
|
||||
});
|
||||
}
|
||||
export default processCSV;
|
||||
Reference in New Issue
Block a user