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

Method clear_query

src/utils/cache.py:66–81  ·  view source on GitHub ↗

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

(self)

Source from the content-addressed store, hash-verified

64 return None
65
66 def clear_query(self):
67 """
68 清理查询相关的临时数据
69 移除查询过程中产生的临时数据,保持缓存清洁
70 """
71 for k, v in self.cache_kwargs.items():
72 if "compacked_key_cache" in v:
73 v.pop("compacked_key_cache")
74 v.pop("compacked_value_cache")
75 if "prefill_stage2_kvcache_size" in v:
76 v.pop("prefill_stage2_kvcache_size")
77 if "prefill_stage1_kvcache_size" in v:
78 v.pop("prefill_stage1_kvcache_size")
79 if "recall_topk" in v:
80 v.pop("recall_topk")
81 return self
82
83 def get_seq_length(self, layer_idx=0) -> int:
84 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected