From 36315c2b0cea7ca88e78fdc89ed9f8f245633a5c Mon Sep 17 00:00:00 2001 From: Nick Ludlam Date: Wed, 11 Sep 2024 16:09:31 +0100 Subject: [PATCH] Pass capacity_bytes to diskcache.Cache() as size_limit to allow caches > 1GB --- llama_cpp/llama_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama_cpp/llama_cache.py b/llama_cpp/llama_cache.py index 5220c7933..7cdafd7aa 100644 --- a/llama_cpp/llama_cache.py +++ b/llama_cpp/llama_cache.py @@ -108,7 +108,7 @@ def __init__( self, cache_dir: str = ".cache/llama_cache", capacity_bytes: int = (2 << 30) ): super().__init__(capacity_bytes) - self.cache = diskcache.Cache(cache_dir) + self.cache = diskcache.Cache(cache_dir, size_limit=capacity_bytes) @property def cache_size(self):