fix: Clear kv cache to avoid kv bug when image is evaluated first
This commit is contained in:
parent
4badac3a60
commit
ac55d0a175
1 changed files with 1 additions and 0 deletions
|
@ -2637,6 +2637,7 @@ class Llava15ChatHandler:
|
||||||
|
|
||||||
# Evaluate prompt
|
# Evaluate prompt
|
||||||
llama.reset()
|
llama.reset()
|
||||||
|
llama._ctx.kv_cache_clear()
|
||||||
for type_, value in split_text:
|
for type_, value in split_text:
|
||||||
if type_ == "text":
|
if type_ == "text":
|
||||||
tokens = llama.tokenize(value.encode("utf8"), add_bos=False, special=True)
|
tokens = llama.tokenize(value.encode("utf8"), add_bos=False, special=True)
|
||||||
|
|
Loading…
Reference in a new issue