We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8045af9 + 038e28b commit 372c9cfCopy full SHA for 372c9cf
candle-transformers/src/models/quantized_phi3.rs
@@ -136,6 +136,9 @@ impl LayerWeights {
136
let q = self.apply_rotary_emb(&q, index_pos)?.contiguous()?;
137
let k = self.apply_rotary_emb(&k, index_pos)?;
138
139
+ if index_pos == 0 {
140
+ self.kv_cache.reset();
141
+ }
142
let (k, v) = self.kv_cache.append(&k.contiguous()?, &v.contiguous()?)?;
143
144
let k = crate::utils::repeat_kv(k, self.n_head / self.n_kv_head)?;
0 commit comments