Docs: Update Gemini benchmark results

This commit is contained in:
github-actions[bot]
2025-11-18 22:04:41 +00:00
parent 31a18dd4ee
commit 33b8150958
220 changed files with 3256 additions and 1491 deletions
@@ -1,21 +1,21 @@
const processCSV = async (csvString, config) => {
const { parse } = await import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm');
const { filterColumn: fc, filterValue: fv, groupBy: gb, aggregateColumn: ac, operation: op } = config;
const acc = {};
const processCSV = async (csv, { filterColumn: fc, filterValue: fv, groupBy: gb, aggregateColumn: ac, operation: op }) => {
const { default: Papa } = await import('https://esm.sh/papaparse@5.4.1');
const { data } = Papa.parse(csv, { header: true, skipEmptyLines: true });
parse(csvString, { header: true, skipEmptyLines: true }).data.forEach(row => {
if (row[fc] == fv) {
const key = row[gb];
const val = +row[ac] || 0;
const entry = acc[key] ??= { sum: 0, count: 0 };
entry.sum += val;
entry.count++;
}
});
const groups = data.reduce((acc, row) => {
if (row[fc] == fv) {
const key = row[gb];
const val = +row[ac] || 0;
acc[key] = acc[key] || { s: 0, c: 0 };
acc[key].s += val;
acc[key].c++;
}
return acc;
}, {});
return Object.entries(acc).map(([key, { sum, count }]) => ({
[gb]: key,
result: op === 'avg' ? sum / count : op === 'count' ? count : sum
}));
return Object.entries(groups).map(([key, { s, c }]) => ({
[gb]: key,
result: op === 'count' ? c : op === 'sum' ? s : s / c
}));
};
export default processCSV;