Implementation of LlamaDiskCache lacks capacity setting.
還沒有人認領這個 Issue。
評估
研究方向
該 issue 位於 llama-cpp-python 程式碼庫的 LlamaDiskCache 類別中。尋找包含此類別的檔案,該檔案可能位於 cache 模組中。修正方式是將 capacity_bytes 參數以 size_limit 的形式傳遞給 diskcache.Cache。完成變更後,執行現有的快取相關測試,以確保容量設定正常運作。
由索引模型根據 Issue 內容生成。
描述
LlamaDiskCache utilizes diskcache module to hold cache.
While LlamaDiskCache.__init__ can have capacity setting, it's not passed to diskcache.Cache.__init__, which is causing capacity mismatch, and it fails to store data of size greater than 1GB (default capacity of diskcache).
Current implementation:
class LlamaDiskCache(BaseLlamaCache):
"""Cache for a llama.cpp model using disk."""
def __init__(
self, cache_dir: str = ".cache/llama_cache", capacity_bytes: int = (2 << 30)
):
super().__init__(capacity_bytes)
self.cache = diskcache.Cache(cache_dir)
This I guess is required:
class LlamaDiskCache(BaseLlamaCache):
"""Cache for a llama.cpp model using disk."""
def __init__(
self, cache_dir: str = ".cache/llama_cache", capacity_bytes: int = (2 << 30)
):
super().__init__(capacity_bytes)
self.cache = diskcache.Cache(cache_dir, size_limit=capacity_bytes) # Added size_limit configuration.
- 主要語言
- Python
- 星號
- 10.6k
- 分支
- 1.5k
- 平均合併
- 23 分鐘
- 30 天內合併 PR
- 1
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
abetlen/llama-cpp-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2352 ·
-
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2211 · 2 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2210 ·
-
難度 2/5 1-3 小時 新手友好度 65/100
abetlen/llama-cpp-python#2145 ·
-
難度 1/5 1 小時以內 新手友好度 75/100
abetlen/llama-cpp-python#2135 · 4 個 reaction ·
查看 abetlen/llama-cpp-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
-
難度 2/5 1-3 小時 新手友好度 82/100
-
難度 2/5 1-3 小時 新手友好度 78/100
-
enhancement
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 2/5 1-3 小時 新手友好度 74/100