From dd3776ea1e7f06ff5eba41683f354292cf5e8ee6 Mon Sep 17 00:00:00 2001 From: osmarks Date: Thu, 17 Oct 2024 21:18:32 +0100 Subject: [PATCH] fix failovers --- src/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util.py b/src/util.py index 14ac4a8..a18741c 100644 --- a/src/util.py +++ b/src/util.py @@ -386,6 +386,8 @@ async def generate(sess: aiohttp.ClientSession, prompt, stop=["\n"]): try: result = await generate_raw(sess, backend, prompt, stop) backend_successes.labels(backend["url"]).inc() + failure_stats = last_failures[backend["url"]] + failure_stats.consecutive_failures = 0 return result except Exception as e: backend_failures.labels(backend["url"]).inc()