Is it possible to remove kv_cache entirely? #568
Unanswered
catalwaysright
asked this question in
Q&A
Replies: 1 comment 4 replies
-
You can disable it by commenting out all the lines except the return line in def logits(self, tokens: Tensor, audio_features: Tensor) -> Tensor:
# if not self.kv_cache:
# self.kv_cache, self.hooks = self.model.install_kv_cache_hooks()
#
# if tokens.shape[-1] > self.initial_token_length:
# # only need to use the last token except in the first forward pass
# tokens = tokens[:, -1:]
return self.model.decoder(tokens, audio_features, kv_cache=self.kv_cache) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to get rid of the kv_cache in whisper, including install_hooks for decoder. Is there some way I can do this? Any clue?
Beta Was this translation helpful? Give feedback.
All reactions