Docs: Update benchmark for openrouter/bert-nebulon-alpha

This commit is contained in:
github-actions[bot]
2025-11-25 21:20:48 +00:00
parent 40160415c2
commit a175f18319
12 changed files with 333 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
const processCSV = async (csvData, config) => {
const { parse } = await import('https://cdn.skypack.dev/papaparse@5.3.0')
const { filterColumn, filterValue, groupBy, aggregateColumn, operation } = config
const { data } = parse(csvData, { header: true })
const filtered = data.filter(row => row[filterColumn] == filterValue)
const groups = filtered.reduce((acc, row) => {
const key = row[groupBy]
if (!acc[key]) acc[key] = []
acc[key].push(row)
return acc
}, {})
return Object.entries(groups).map(([groupValue, rows]) => {
const numbers = rows.map(row => +row[aggregateColumn] || 0)
let result
if (operation === 'sum') result = numbers.reduce((a, b) => a + b, 0)
if (operation === 'avg') result = numbers.reduce((a, b) => a + b, 0) / numbers.length
if (operation === 'count') result = numbers.length
return { [groupBy]: groupValue, result }
})
}
export default processCSV;