mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-12 15:45:00 +00:00
feat: Add quantization performance chart using Chart.js and quant.yml data
This commit is contained in:
parent
8eda09533d
commit
7fba332f58
2 changed files with 43 additions and 4 deletions
38
aider/website/_includes/quant-chart.js
Normal file
38
aider/website/_includes/quant-chart.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var ctx = document.getElementById('quantChart').getContext('2d');
|
||||
var chartData = {
|
||||
labels: [],
|
||||
datasets: [{
|
||||
label: 'Percent completed correctly',
|
||||
data: [],
|
||||
backgroundColor: 'rgba(54, 162, 235, 0.2)',
|
||||
borderColor: 'rgba(54, 162, 235, 1)',
|
||||
borderWidth: 1
|
||||
}]
|
||||
};
|
||||
|
||||
var allData = [];
|
||||
{% for row in site.data.quant %}
|
||||
allData.push({
|
||||
model: '{{ row.model }}',
|
||||
pass_rate_2: {{ row.pass_rate_2 }}
|
||||
});
|
||||
{% endfor %}
|
||||
|
||||
allData.forEach(function(row) {
|
||||
chartData.labels.push(row.model);
|
||||
chartData.datasets[0].data.push(row.pass_rate_2);
|
||||
});
|
||||
|
||||
new Chart(ctx, {
|
||||
type: 'bar',
|
||||
data: chartData,
|
||||
options: {
|
||||
scales: {
|
||||
y: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue