Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lade/decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ def copy_from_last():

first_guess = next_tokens.item()
max_hit = 0
hits = [first_guess] + [0] * (GUESS_SIZE - 1)
hits = [first_guess] + [0] * GUESS_SIZE

new_results = []

Expand Down Expand Up @@ -1075,8 +1075,9 @@ def copy_from_last():
correct = [first_guess] + guess_results[egx:egx + GUESS_SIZE]
myguess = guess_tokens[egx:egx + GUESS_SIZE]
gg = 0
for gg in range(len(myguess)):
if myguess[gg] != correct[gg]:
# if all tokens in myguess equal to correct, gg should be len(myguess)
for gg in range(len(myguess) + 1):
if gg >= len(myguess) or myguess[gg] != correct[gg]:
break
if gg > max_hit:
max_hit = gg
Expand Down