mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark for x-ai/grok-4.1-fast
This commit is contained in:
15
tests/6_csv_processor/outputs/x-ai_grok-4.1-fast.js
Normal file
15
tests/6_csv_processor/outputs/x-ai_grok-4.1-fast.js
Normal file
@@ -0,0 +1,15 @@
|
||||
async function processCSV(csv, config) {
|
||||
const [{ default: Papa }, { aq, sum, mean, count }] = await Promise.all([
|
||||
import('https://cdn.skypack.dev/papaparse'),
|
||||
import('https://cdn.skypack.dev/arquero')
|
||||
]);
|
||||
const data = Papa.parse(csv, { header: true, skipEmptyLines: true }).data;
|
||||
const { filterColumn, filterValue, groupBy, aggregateColumn, operation } = config;
|
||||
let table = aq.from(data).filter(d => d[filterColumn] == filterValue);
|
||||
if (operation !== 'count') {
|
||||
table = table.derive({ [aggregateColumn]: d => Number(d[aggregateColumn]) || 0 });
|
||||
}
|
||||
const makeAgg = operation === 'count' ? count() : { sum: sum, avg: mean }[operation](aggregateColumn);
|
||||
return table.groupby(groupBy).rollup({ result: makeAgg }).objects();
|
||||
}
|
||||
export default processCSV;
|
||||
Reference in New Issue
Block a user