Skip to content

Commit

Permalink
Merge pull request meta-llama#403 from tianweidut/bug/fix-probs-refer…
Browse files Browse the repository at this point in the history
…ence

bug: fix local variable 'probs' referenced before assignment typo
  • Loading branch information
ruanslv authored Jul 19, 2023
2 parents 4d92db8 + 37362e0 commit cc8a000
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 cc8a000

Please sign in to comment.