fix: Return empty dict instead of exiting on model availability error

This commit is contained in:
Stefan Hladnik (aider) 2025-03-18 12:18:48 +07:00 committed by Stefan Hladnik
parent 7c3d96d0e7
commit b3d9e0d1b0

View file

@ -249,7 +249,7 @@ class ModelInfoManager:
import re
if re.search(rf'The model\s*.*{re.escape(url_part)}.* is not available', html, re.IGNORECASE):
print(f"\033[91mError: Model '{url_part}' is not available\033[0m")
sys.exit(1)
return {}
text = re.sub(r'<[^>]+>', ' ', html)
context_match = re.search(r"([\d,]+)\s*context", text)
if context_match: