From 624776708a35fc2dce9e14b60bdc1a298bc34ce0 Mon Sep 17 00:00:00 2001 From: Khoa Nguyen Date: Sun, 25 Jun 2023 11:37:49 +0200 Subject: [PATCH] chore: move clear cache command inside wrapper --- app/routes/health.py | 1 - app/services/guidance_wrapper.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routes/health.py b/app/routes/health.py index e7eb9dea..187984cd 100644 --- a/app/routes/health.py +++ b/app/routes/health.py @@ -14,7 +14,6 @@ def checkhealth(): result = [] for model in LLMModel: - guidance.llms.OpenAI.cache.clear() circuit_status = CircuitBreaker.get_status( func=GuidanceWrapper(model=model).is_up, cache_key=model, diff --git a/app/services/guidance_wrapper.py b/app/services/guidance_wrapper.py index 0a47ac6d..0858f111 100644 --- a/app/services/guidance_wrapper.py +++ b/app/services/guidance_wrapper.py @@ -48,6 +48,7 @@ def is_up(self) -> bool: True if the model is up, False otherwise. """ + guidance.llms.OpenAI.cache.clear() handlebars = """ {{#user~}}Say 1{{~/user}} {{#assistant~}}