From ea7fac4274e47dc6b604bc7f9f1abe2de5578a96 Mon Sep 17 00:00:00 2001 From: osmarks Date: Mon, 21 Oct 2024 20:40:23 +0100 Subject: [PATCH] failover mechanism got stuck, oops --- src/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.py b/src/util.py index a18741c..cad7a89 100644 --- a/src/util.py +++ b/src/util.py @@ -378,7 +378,7 @@ async def generate(sess: aiohttp.ClientSession, prompt, stop=["\n"]): # high to low def sort_key(backend): failure_stats = last_failures[backend["url"]] - return (failure_stats.avoid_until is None or failure_stats.avoid_until < now), -failure_stats.consecutive_failures, backend["priority"] + return (failure_stats.avoid_until is None or failure_stats.avoid_until < now), backend["priority"], -failure_stats.consecutive_failures backends = sorted(backends, key=sort_key, reverse=True)