Docs: Update benchmark for minimax/minimax-m2.7

This commit is contained in:
github-actions[bot]
2026-03-19 02:49:47 +00:00
parent b28fac2b40
commit 5519a81f65
12 changed files with 375 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
async function processCSV(csvString, config) {
const {
filterColumn,
filterValue,
groupBy,
aggregateColumn,
operation
} = config;
const { default: Papa } = await import('https://esm.sh/papaparse');
const { data: rows, errors } = Papa.parse(csvString, {
header: true,
skipEmptyLines: true
});
if (errors.length) throw new Error('CSV parsing failed: ' + errors[0].message);
const filtered = rows.filter(r => r[filterColumn] == filterValue);
const groups = new Map();
for (const row of filtered) {
const key = row[groupBy];
if (!groups.has(key)) groups.set(key, { sum: 0, count: 0 });
const entry = groups.get(key);
const num = Number(row[aggregateColumn]);
entry.sum += isNaN(num) ? 0 : num;
entry.count++;
}
const resultArr = [...groups].map(([key, val]) => {
let result;
if (operation === 'sum') result = val.sum;
else if (operation === 'avg') result = val.count ? val.sum / val.count : 0;
else if (operation === 'count') result = val.count;
else throw new Error('Unsupported operation: ' + operation);
return { [groupBy]: key, result };
});
return resultArr;
}
export default processCSV;
// Generation time: 61.787s
// Result: PASS