mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
updated benchmark to new Coder & Model classes
This commit is contained in:
parent
05cdd9f2ec
commit
434fa5f6a7
1 changed files with 1 additions and 18 deletions
|
@ -17,7 +17,6 @@ import git
|
||||||
import lox
|
import lox
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import openai
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import prompts
|
import prompts
|
||||||
import typer
|
import typer
|
||||||
|
@ -956,22 +955,7 @@ def run_test(
|
||||||
chat_history_file=history_fname,
|
chat_history_file=history_fname,
|
||||||
)
|
)
|
||||||
|
|
||||||
if "OPENAI_API_BASE" in os.environ and "openrouter.ai" in os.environ["OPENAI_API_BASE"]:
|
main_model = models.Model(model_name)
|
||||||
client = openai.OpenAI(
|
|
||||||
api_key=os.environ["OPENAI_API_KEY"],
|
|
||||||
base_url=os.environ.get("OPENAI_API_BASE"),
|
|
||||||
default_headers={
|
|
||||||
"HTTP-Referer": "http://aider.chat",
|
|
||||||
"X-Title": "Aider",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
client = openai.OpenAI(
|
|
||||||
api_key=os.environ["OPENAI_API_KEY"],
|
|
||||||
base_url=os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1"),
|
|
||||||
)
|
|
||||||
|
|
||||||
main_model = models.Model.create(model_name, client)
|
|
||||||
edit_format = edit_format or main_model.edit_format
|
edit_format = edit_format or main_model.edit_format
|
||||||
|
|
||||||
dump(main_model)
|
dump(main_model)
|
||||||
|
@ -983,7 +967,6 @@ def run_test(
|
||||||
main_model,
|
main_model,
|
||||||
edit_format,
|
edit_format,
|
||||||
io,
|
io,
|
||||||
client=client,
|
|
||||||
fnames=fnames,
|
fnames=fnames,
|
||||||
use_git=False,
|
use_git=False,
|
||||||
stream=False,
|
stream=False,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue