MCPcopy Index your code
hub / github.com/Standard-Intelligence/hertz-dev / init_cache

Method init_cache

model.py:291–295  ·  view source on GitHub ↗
(self, bsize, device, dtype, length:int=None)

Source from the content-addressed store, hash-verified

289 return self.audio_tokenizer.data_from_latent(token_data)[..., -(token_data.shape[1]*2000):]
290
291 def init_cache(self, bsize, device, dtype, length:int=None):
292 cache_shape = [self.c.stack_config.layers, length or self.c.stack_config.seq_len, 2, self.kv_heads, self.head_dim]
293 self.cache = T.full((bsize, *cache_shape), CACHE_FILL_VALUE, device=device, dtype=dtype).transpose(0, 1)
294 self.resynthesizer.init_cache(bsize, device, dtype, length)
295 self.use_audio_cache = True
296
297 def deinit_cache(self):
298 self.cache = [None] * len(self.layers)

Callers 1

completionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected