Skip to content

Commit

Permalink
fix local variable 'probs' referenced before assignment issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tianweidut authored Jul 19, 2023
1 parent 4d92db8 commit 37362e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions llama/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def generate(
# cut to max gen len
start = 0 if echo else len(prompt_tokens[i])
toks = toks[start : len(prompt_tokens[i]) + max_gen_len]
probs = None
if logprobs:
probs = token_logprobs[i][start : len(prompt_tokens[i]) + max_gen_len]
# cut to eos tok if any
Expand Down

0 comments on commit 37362e0

Please sign in to comment.