Ignore non-object embedding endpoint config (#1260)

This commit is contained in:
red person
2026-06-03 08:12:41 +03:00
committed by GitHub
parent 42ef4b6502
commit 84d54d9853
2 changed files with 27 additions and 1 deletions
+2 -1
View File
@@ -86,7 +86,8 @@ def _load_custom_endpoint() -> dict:
"""Load the saved custom embedding endpoint, if any."""
try:
if os.path.exists(_ENDPOINT_FILE):
return json.loads(Path(_ENDPOINT_FILE).read_text(encoding="utf-8"))
data = json.loads(Path(_ENDPOINT_FILE).read_text(encoding="utf-8"))
return data if isinstance(data, dict) else {}
except Exception:
pass
return {}