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

Method copy

src/utils/cache.py:101–115  ·  view source on GitHub ↗

创建缓存的深拷贝 Returns: CustomDynamicCache: 缓存的新副本

(self)

Source from the content-addressed store, hash-verified

99 return layer_seq_length
100
101 def copy(self):
102 """
103 创建缓存的深拷贝
104
105 Returns:
106 CustomDynamicCache: 缓存的新副本
107 """
108 new_cache = CustomDynamicCache()
109 new_cache.key_cache = [k.clone() for k in self.key_cache]
110 new_cache.value_cache = [v.clone() for v in self.value_cache]
111 new_cache.cache_kwargs = copy.deepcopy(self.cache_kwargs)
112 new_cache.group_cache = copy.deepcopy(self.group_cache)
113 new_cache.meta = copy.deepcopy(self.meta)
114 new_cache._seen_tokens = self._seen_tokens
115 return new_cache
116
117 def update_router_kcache(
118 self,

Callers 2

generateMethod · 0.45
_sampleMethod · 0.45

Calls 1

CustomDynamicCacheClass · 0.85

Tested by

no test coverage detected