Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions scripts/aggregate_evals.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,40 +155,47 @@ function generateMarkdown(currentStatsByModel, history) {

const models = Object.keys(currentStatsByModel).sort();

for (const model of models) {
const currentStats = currentStatsByModel[model];
const totalStats = Object.values(currentStats).reduce(
const getPassRate = (statsForModel) => {
if (!statsForModel) return '-';
const totalStats = Object.values(statsForModel).reduce(
(acc, stats) => {
acc.passed += stats.passed;
acc.total += stats.total;
return acc;
},
{ passed: 0, total: 0 },
);
return totalStats.total > 0
? ((totalStats.passed / totalStats.total) * 100).toFixed(1) + '%'
: '-';
};

const totalPassRate =
totalStats.total > 0
? ((totalStats.passed / totalStats.total) * 100).toFixed(1) + '%'
: 'N/A';
for (const model of models) {
const currentStats = currentStatsByModel[model];
const totalPassRate = getPassRate(currentStats);

console.log(`#### Model: ${model}`);
console.log(`**Total Pass Rate: ${totalPassRate}**\n`);

// Header
let header = '| Test Name |';
let separator = '| :--- |';
let passRateRow = '| **Overall Pass Rate** |';

for (const item of reversedHistory) {
header += ` [${item.run.databaseId}](${item.run.url}) |`;
separator += ' :---: |';
passRateRow += ` **${getPassRate(item.stats[model])}** |`;
}

// Add Current column last
header += ' Current |';
separator += ' :---: |';
passRateRow += ` **${totalPassRate}** |`;

console.log(header);
console.log(separator);
console.log(passRateRow);

// Collect all test names for this model
const allTestNames = new Set(Object.keys(currentStats));
Expand Down
Loading