MCPcopy Create free account
hub / github.com/EverMind-AI/MSA / clear_query

Method clear_query

src/utils/cache.py:300–315  ·  view source on GitHub ↗

清理查询相关的临时数据 移除查询过程中产生的临时数据,保持缓存清洁

(self)

Source from the content-addressed store, hash-verified

298 return layer_seq_length
299
300 def clear_query(self):
301 """
302 清理查询相关的临时数据
303 移除查询过程中产生的临时数据,保持缓存清洁
304 """
305 for k, v in self.cache_kwargs.items():
306 if "compacked_key_cache" in v:
307 v.pop("compacked_key_cache")
308 v.pop("compacked_value_cache")
309 if "prefill_stage2_kvcache_size" in v:
310 v.pop("prefill_stage2_kvcache_size")
311 if "prefill_stage1_kvcache_size" in v:
312 v.pop("prefill_stage1_kvcache_size")
313 if "recall_topk" in v:
314 v.pop("recall_topk")
315 return self
316
317 def copy(self):
318 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected