mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 05:45:00 +00:00
benchmark works
This commit is contained in:
parent
caf58cf313
commit
e2cbc17f07
1 changed files with 17 additions and 8 deletions
|
@ -23,11 +23,12 @@ def create_temp_repo(dirname, tempdir):
|
||||||
shutil.copy2(s, d)
|
shutil.copy2(s, d)
|
||||||
|
|
||||||
add_files = []
|
add_files = []
|
||||||
for root, _, files in os.walk(tempdir):
|
for file in os.listdir(tempdir):
|
||||||
for file in files:
|
dump(file)
|
||||||
if "test" not in file:
|
full_path = os.path.join(tempdir, file)
|
||||||
rel_path = os.path.relpath(os.path.join(root, file), tempdir)
|
|
||||||
add_files.append(rel_path)
|
if "test" not in file and os.path.isfile(full_path):
|
||||||
|
add_files.append(file)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# Create a new git repo in tempdir
|
# Create a new git repo in tempdir
|
||||||
|
@ -57,7 +58,7 @@ def main(tempdir):
|
||||||
|
|
||||||
fnames = create_temp_repo(dirname, tempdir)
|
fnames = create_temp_repo(dirname, tempdir)
|
||||||
tempdir = Path(tempdir)
|
tempdir = Path(tempdir)
|
||||||
fnames = [tempdir / fn for fn in fnames]
|
fnames = [str(tempdir / fn) for fn in fnames]
|
||||||
|
|
||||||
io = InputOutput(
|
io = InputOutput(
|
||||||
pretty=True,
|
pretty=True,
|
||||||
|
@ -66,6 +67,8 @@ def main(tempdir):
|
||||||
|
|
||||||
main_model = models.Model("gpt-3.5-turbo")
|
main_model = models.Model("gpt-3.5-turbo")
|
||||||
|
|
||||||
|
dump(fnames)
|
||||||
|
|
||||||
coder = Coder.create(
|
coder = Coder.create(
|
||||||
main_model,
|
main_model,
|
||||||
None,
|
None,
|
||||||
|
@ -73,10 +76,16 @@ def main(tempdir):
|
||||||
os.environ["OPENAI_API_KEY"],
|
os.environ["OPENAI_API_KEY"],
|
||||||
fnames=fnames,
|
fnames=fnames,
|
||||||
verbose=True,
|
verbose=True,
|
||||||
git=False,
|
use_git=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
coder.run(with_message="follow the instructions in the .md file")
|
instructions = (tempdir / "docs/instructions.md").read_text()
|
||||||
|
|
||||||
|
instructions += (
|
||||||
|
"\n\n=====\n\nModify these files according to the above instructions: " + " ".join(fnames)
|
||||||
|
)
|
||||||
|
|
||||||
|
coder.run(with_message=instructions)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue