Skip to content

Commit a0b808b

Browse files
authored
Reset kvCacheLength on #clearKVCache (#85)
After `asyncOnReset` I was getting an error when trying to start a new conversation. After some trial and error I've found that `kvCacheLength` being reset to `0` fixed the issue. Based on the discussion in #83 I have created this PR to upstream the fix that worked for me.
1 parent 5752f45 commit a0b808b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

web/llm_chat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ class LLMChatPipeline {
178178

179179
#clearKVCache() {
180180
this.fclearKVCaches(this.kvCache);
181+
this.kvCacheLength = 0;
181182
}
182183

183184
#forward(inputs, curPos) {

0 commit comments

Comments
 (0)