mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
catch 404s from azure on models.list
This commit is contained in:
parent
ad092152d0
commit
cab7460f94
2 changed files with 9 additions and 2 deletions
|
@ -953,7 +953,14 @@ class Coder:
|
||||||
|
|
||||||
|
|
||||||
def check_model_availability(io, client, main_model):
|
def check_model_availability(io, client, main_model):
|
||||||
available_models = client.models.list()
|
try:
|
||||||
|
available_models = client.models.list()
|
||||||
|
except openai.NotFoundError:
|
||||||
|
# Azure sometimes returns 404?
|
||||||
|
# https://discord.com/channels/1131200896827654144/1182327371232186459
|
||||||
|
io.tool_error("Unable to list available models, proceeding with {main_model.name}")
|
||||||
|
return True
|
||||||
|
|
||||||
model_ids = sorted(model.id for model in available_models)
|
model_ids = sorted(model.id for model in available_models)
|
||||||
if main_model.name in model_ids:
|
if main_model.name in model_ids:
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -30,7 +30,7 @@ from aider.coders import Coder
|
||||||
from aider.dump import dump # noqa: F401
|
from aider.dump import dump # noqa: F401
|
||||||
from aider.io import InputOutput
|
from aider.io import InputOutput
|
||||||
|
|
||||||
BENCHMARK_DNAME = Path(os.environ["AIDER_BENCHMARK_DIR"])
|
BENCHMARK_DNAME = Path(os.environ.get("AIDER_BENCHMARK_DIR", "tmp.benchmarks"))
|
||||||
|
|
||||||
ORIGINAL_DNAME = BENCHMARK_DNAME / "exercism-python"
|
ORIGINAL_DNAME = BENCHMARK_DNAME / "exercism-python"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue