From bb63cc8c18bfd43051c2cf90004338bd2686f964 Mon Sep 17 00:00:00 2001 From: JonahSussman Date: Fri, 10 Jan 2025 13:05:09 -0500 Subject: [PATCH] Hack to fix cache Signed-off-by: JonahSussman --- kai/llm_interfacing/model_provider.py | 1 + kai/rpc_server/server.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/kai/llm_interfacing/model_provider.py b/kai/llm_interfacing/model_provider.py index 3dc16788..d8e38369 100644 --- a/kai/llm_interfacing/model_provider.py +++ b/kai/llm_interfacing/model_provider.py @@ -39,6 +39,7 @@ def __init__( self.llm_retry_delay: float = config.llm_retry_delay self.demo_mode: bool = demo_mode self.cache_dir = cache_dir + LOG.info("using cache dir: %s", self.cache_dir) model_class: type[BaseChatModel] defaults: dict[str, Any] diff --git a/kai/rpc_server/server.py b/kai/rpc_server/server.py index 2c40e48c..f3c79217 100644 --- a/kai/rpc_server/server.py +++ b/kai/rpc_server/server.py @@ -67,7 +67,7 @@ class KaiRpcApplicationConfig(CamelCaseBaseModel): log_config: KaiLogConfig demo_mode: bool = False - cache_dir: Optional[AutoAbsPath] = PATH_LLM_CACHE + cache_dir: Optional[AutoAbsPath] = None enable_reflection: bool = True analyzer_lsp_lsp_path: AutoAbsPathExists @@ -174,6 +174,9 @@ def initialize( try: app.config = params + if app.config.cache_dir is None: + app.config.cache_dir = PATH_LLM_CACHE + try: model_provider = ModelProvider( app.config.model_provider, app.config.demo_mode, app.config.cache_dir