mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
style: Organize imports and apply linter formatting
This commit is contained in:
parent
6d6d763dd3
commit
c189a52e5e
1 changed files with 16 additions and 13 deletions
|
@ -1,10 +1,12 @@
|
||||||
|
from dataclasses import dataclass
|
||||||
|
from datetime import date
|
||||||
|
from typing import Dict, List, Tuple
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import yaml
|
import yaml
|
||||||
from imgcat import imgcat
|
from imgcat import imgcat
|
||||||
from matplotlib import rc
|
from matplotlib import rc
|
||||||
from dataclasses import dataclass
|
|
||||||
from typing import List, Tuple, Dict
|
|
||||||
from datetime import date
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ModelData:
|
class ModelData:
|
||||||
|
@ -56,6 +58,7 @@ class ModelData:
|
||||||
return "Mistral"
|
return "Mistral"
|
||||||
return model
|
return model
|
||||||
|
|
||||||
|
|
||||||
class BenchmarkPlotter:
|
class BenchmarkPlotter:
|
||||||
LABEL_FONT_SIZE = 16
|
LABEL_FONT_SIZE = 16
|
||||||
|
|
||||||
|
@ -78,7 +81,7 @@ class BenchmarkPlotter:
|
||||||
model = ModelData(
|
model = ModelData(
|
||||||
name=entry["model"].split("(")[0].strip(),
|
name=entry["model"].split("(")[0].strip(),
|
||||||
release_date=entry["released"],
|
release_date=entry["released"],
|
||||||
pass_rate=entry["pass_rate_2"]
|
pass_rate=entry["pass_rate_2"],
|
||||||
)
|
)
|
||||||
models.append(model)
|
models.append(model)
|
||||||
return models
|
return models
|
||||||
|
@ -126,9 +129,7 @@ class BenchmarkPlotter:
|
||||||
def set_labels_and_style(self, ax: plt.Axes):
|
def set_labels_and_style(self, ax: plt.Axes):
|
||||||
ax.set_xlabel("Model release date", fontsize=18, color="#555")
|
ax.set_xlabel("Model release date", fontsize=18, color="#555")
|
||||||
ax.set_ylabel(
|
ax.set_ylabel(
|
||||||
"Aider code editing benchmark,\npercent completed correctly",
|
"Aider code editing benchmark,\npercent completed correctly", fontsize=18, color="#555"
|
||||||
fontsize=18,
|
|
||||||
color="#555"
|
|
||||||
)
|
)
|
||||||
ax.set_title("LLM code editing skill by model release date", fontsize=20)
|
ax.set_title("LLM code editing skill by model release date", fontsize=20)
|
||||||
ax.set_ylim(30, 90)
|
ax.set_ylim(30, 90)
|
||||||
|
@ -147,9 +148,11 @@ class BenchmarkPlotter:
|
||||||
self.set_labels_and_style(ax)
|
self.set_labels_and_style(ax)
|
||||||
self.save_and_display(fig)
|
self.save_and_display(fig)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
plotter = BenchmarkPlotter()
|
plotter = BenchmarkPlotter()
|
||||||
plotter.plot("aider/website/_data/edit_leaderboard.yml")
|
plotter.plot("aider/website/_data/edit_leaderboard.yml")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue