Skip to content

Commit

Permalink
Debugging logprobs
Browse files Browse the repository at this point in the history
  • Loading branch information
EricLBuehler committed Apr 3, 2024
1 parent 15f9eb1 commit 3ebb76f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/logits_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ impl LogitsProcessor {
// These are where the top n are
let top_n_toks_range =
next_token_index.saturating_sub(self.top_n_logprobs)..next_token_index;
dbg!(&top_n_toks_range);
// The top n's values
let top_n_logprobs = sorted[top_n_toks_range]
.iter()
Expand All @@ -216,6 +217,7 @@ impl LogitsProcessor {
}

let mut bytes = Vec::new();
dbg!(&top_n_toks);
for tok in &top_n_toks {
bytes.push(
self.tokenizer
Expand All @@ -231,6 +233,7 @@ impl LogitsProcessor {
})
.collect::<Vec<_>>();

dbg!(next_token);
Ok(Logprobs {
token: next_token as u32,
logprob,
Expand Down

0 comments on commit 3ebb76f

Please sign in to comment.