From 89db1d8673be36e4e02e8acca6704b0888a5096c Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 6 May 2024 11:50:10 -0700 Subject: [PATCH] aider: Added a second bar for `row.percent_cases_well_formed` to each graph. # Aider chat conversation: USER: in each graph, give each model a second bar showing row.percent_cases_well_formed ASSISTANT: Here are the changes to add a second bar for `row.percent_cases_well_formed` to each graph: docs/leaderboards/index.md ```markdown <<<<<<< SEARCH var leaderboardData = { labels: [], datasets: [{ label: 'Percent correct on code editing tasks', data: [], backgroundColor: 'rgba(54, 162, 235, 0.2)', borderColor: 'rgba(54, 162, 235, 1)', borderWidth: 1 }] }; {% for row in edit_sorted %} leaderboardData.labels.push('{{ row.model }}'); leaderboardData.datasets[0].data.push({{ row.pass_rate_2 }}); {% endfor %} ======= var leaderboardData = { labels: [], datasets: [{ label: 'Percent correct on code editing tasks', data: [], backgroundColor: 'rgba(54, 162, 235, 0.2)', borderColor: 'rgba(54, 162, 235, 1)', borderWidth: 1 }, { label: 'Percent cases well formed', data: [], backgroundColor: 'rgba(255, 99, 132, 0.2)', borderColor: 'rgba(255, 99, 132, 1)', borderWidth: 1 }] }; {% for row in edit_sorted %} leaderboardData.labels.push('{{ row.model }}'); leaderboardData.datasets[0].data.push({{ row.pass_rate_2 }}); leaderboardData.datasets[1].data.push({{ row.percent_cases_well_formed }}); {% endfor %} >>>>>>> REPLACE ``` docs/leaderboards/index.md ```markdown <<<<<<< SEARCH var leaderboardData = { labels: [], datasets: [{ label: 'Percent correct on code refactoring tasks', data: [], backgroundColor: 'rgba(54, 162, 235, 0.2)', borderColor: 'rgba(54, 162, 235, 1)', borderWidth: 1 }] }; {% for row in refac_sorted %} leaderboardData.labels.push('{{ row.model }}'); leaderboardData.datasets[0].data.push({{ row.pass_rate_1 }}); {% endfor %} ======= var leaderboardData = { labels: [], datasets: [{ label: 'Percent correct on code refactoring tasks', data: [], backgroundColor: 'rgba(54, 162, 235, 0.2)', borderColor: 'rgba(54, 162, 235, 1)', borderWidth: 1 }, { label: 'Percent cases well formed', data: [], backgroundColor: 'rgba(255, 99, 132, 0.2)', borderColor: 'rgba(255, 99, 132, 1)', borderWidth: 1 }] }; {% for row in refac_sorted %} leaderboardData.labels.push('{{ row.model }}'); leaderboardData.datasets[0].data.push({{ row.pass_rate_1 }}); leaderboardData.datasets[1].data.push({{ row.percent_cases_well_formed }}); {% endfor %} >>>>>>> REPLACE ``` This adds a second dataset to each chart's `leaderboardData`, with a label of "Percent cases well formed". It sets different colors for the bars and borders. Then in the loop that populates the data, it pushes the `row.percent_cases_well_formed` value into the second dataset. With these changes, each model will have two bars - one for the pass rate and one for the percent of cases that were well formed. --- docs/leaderboards/index.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/leaderboards/index.md b/docs/leaderboards/index.md index 8340def79..3e64f0226 100644 --- a/docs/leaderboards/index.md +++ b/docs/leaderboards/index.md @@ -56,12 +56,20 @@ it will work best with models that score well on the benchmarks. backgroundColor: 'rgba(54, 162, 235, 0.2)', borderColor: 'rgba(54, 162, 235, 1)', borderWidth: 1 + }, + { + label: 'Percent cases well formed', + data: [], + backgroundColor: 'rgba(255, 99, 132, 0.2)', + borderColor: 'rgba(255, 99, 132, 1)', + borderWidth: 1 }] }; {% for row in edit_sorted %} leaderboardData.labels.push('{{ row.model }}'); leaderboardData.datasets[0].data.push({{ row.pass_rate_2 }}); + leaderboardData.datasets[1].data.push({{ row.percent_cases_well_formed }}); {% endfor %} var leaderboardChart = new Chart(ctx, { @@ -124,12 +132,20 @@ Therefore, results are available for fewer models. backgroundColor: 'rgba(54, 162, 235, 0.2)', borderColor: 'rgba(54, 162, 235, 1)', borderWidth: 1 + }, + { + label: 'Percent cases well formed', + data: [], + backgroundColor: 'rgba(255, 99, 132, 0.2)', + borderColor: 'rgba(255, 99, 132, 1)', + borderWidth: 1 }] }; {% for row in refac_sorted %} leaderboardData.labels.push('{{ row.model }}'); leaderboardData.datasets[0].data.push({{ row.pass_rate_1 }}); + leaderboardData.datasets[1].data.push({{ row.percent_cases_well_formed }}); {% endfor %} var leaderboardChart = new Chart(ctx, {