Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e966f3b

Browse files
xu-songabetlen
andauthored
feat: Add more detailed log for prefix-match (abetlen#1659)
Co-authored-by: Andrei <[email protected]>
1 parent 8432116 commit e966f3b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llama_cpp/llama.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,12 @@ def generate(
777777
else:
778778
break
779779
if longest_prefix > 0:
780-
if self.verbose:
781-
print("Llama.generate: prefix-match hit", file=sys.stderr)
782780
reset = False
783781
tokens = tokens[longest_prefix:]
784782
self.n_tokens = longest_prefix
783+
if self.verbose:
784+
print(f"Llama.generate: {longest_prefix} prefix-match hit, "
785+
f"remaining {len(tokens)} prompt tokens to eval", file=sys.stderr)
785786

786787
# Reset the model state
787788
if reset:

0 commit comments

Comments
 (0)