mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-06-08 04:22:13 +00:00
Docs: Update benchmark for google/gemini-3.5-flash
This commit is contained in:
24
tests/6_csv_processor/outputs/google_gemini-3.5-flash.js
Normal file
24
tests/6_csv_processor/outputs/google_gemini-3.5-flash.js
Normal file
@@ -0,0 +1,24 @@
|
||||
export async function processCSV(csvString, config) {
|
||||
const { filterColumn, filterValue, groupBy, aggregateColumn, operation } = config;
|
||||
const { default: Papa } = await import('https://cdn.jsdelivr.net/npm/papaparse@5.4.1/+esm');
|
||||
|
||||
const { data } = Papa.parse(csvString, { header: true, skipEmptyLines: true });
|
||||
const groups = {};
|
||||
|
||||
for (const row of data) {
|
||||
if (row[filterColumn] == filterValue) {
|
||||
const groupVal = row[groupBy];
|
||||
groups[groupVal] = groups[groupVal] || { sum: 0, count: 0 };
|
||||
groups[groupVal].sum += +row[aggregateColumn] || 0;
|
||||
groups[groupVal].count++;
|
||||
}
|
||||
}
|
||||
|
||||
return Object.entries(groups).map(([key, { sum, count }]) => ({
|
||||
[groupBy]: key,
|
||||
result: operation === 'count' ? count : operation === 'sum' ? sum : sum / count
|
||||
}));
|
||||
}
|
||||
export default processCSV;
|
||||
// Generation time: 23.400s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user