feat: Add senior/junior code editing benchmark chart

This commit is contained in:
Paul Gauthier 2024-09-26 10:07:59 -07:00 committed by Paul Gauthier (aider)
parent c7e2255570
commit 04cc9d03e9

View file

@ -46,88 +46,6 @@ The graph below and table show the
[aider's code editing benchmark](/docs/benchmarks.html#the-benchmark)
score for various combinations of Senior and Junior models.
<div style="height: 500px;">
<canvas id="seniorJuniorChart"></canvas>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const ctx = document.getElementById('seniorJuniorChart').getContext('2d');
const data = {
labels: [],
datasets: []
};
{% assign sorted_data = site.data.senior | sort: "pass_rate_2" | reverse %}
{% assign grouped_data = sorted_data | group_by: "model" %}
const datasets = [];
{% for group in grouped_data %}
datasets.push({
label: '{{ group.name }}',
data: [],
backgroundColor: getRandomColor(),
});
{% for item in group.items %}
data.labels.push('{{ item.junior_model }} ({{ item.junior_edit_format | default: item.edit_format }})');
datasets[datasets.length - 1].data.push({{ item.pass_rate_2 }});
{% endfor %}
{% endfor %}
data.datasets = datasets;
new Chart(ctx, {
type: 'bar',
data: data,
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
title: {
display: true,
text: 'Pass Rate for Senior/Junior/EditFormat Combinations',
font: {
size: 18
}
},
legend: {
position: 'top',
}
},
scales: {
x: {
stacked: false,
},
y: {
stacked: false,
beginAtZero: true,
max: 100,
title: {
display: true,
text: 'Pass Rate (%)',
font: {
size: 14
}
}
}
}
}
});
});
function getRandomColor() {
const letters = '0123456789ABCDEF';
let color = '#';
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
</script>
Some noteworthy observations: