mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
perf: 降低 lru_cache 上限并限制流式响应块内存占用
- 缩减 model_permissions / tiktoken / formula_engine 的 lru_cache maxsize - StreamUsageTracker 响应块增加 4MB 大小限制,超限后只计数不存储 - raw_chunks 改用 deque(maxlen=50) 避免无限增长 - HardwareTooltip 导入路径修正、tooltip 延迟归零、文案中文化
This commit is contained in:
@@ -22,7 +22,7 @@ except ImportError: # pragma: no cover
|
||||
tiktoken = None
|
||||
|
||||
|
||||
@lru_cache(maxsize=256)
|
||||
@lru_cache(maxsize=32)
|
||||
def _get_encoder_cached(model: str) -> Any:
|
||||
"""全局编码器缓存。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user