feat: Add quantization performance chart using Chart.js and quant.yml data

This commit is contained in:
Paul Gauthier (aider) 2024-11-21 10:57:03 -08:00
parent 8eda09533d
commit 7fba332f58
2 changed files with 43 additions and 4 deletions

View 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
}
}
}
});
});

View file

@ -21,7 +21,8 @@ and local model servers like ollama.
The graph below compares 4 different versions of the Qwen 2.5 32B model,
served both locally and from cloud providers:
- Qwen2.5-Coder-32B-Instruct
- ollama/qwen2.5:32b
- ollama/qwen2.5:32b-instruct-q8_0
- openrouter/qwen/qwen-2.5-coder-32b-instruct
<canvas id="quantChart" width="800" height="450" style="margin: 20px 0"></canvas>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
{% include quant-chart.js %}
</script>