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