Skip to content

Commit

Permalink
make up for the missing last token output of phi2 example (huggingfac…
Browse files Browse the repository at this point in the history
  • Loading branch information
Czxck001 authored Jun 29, 2024
1 parent e27aac0 commit 74e9e41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions candle-examples/examples/phi/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ impl TextGeneration {
tokens.push(next_token);
generated_tokens += 1;
if next_token == eos_token {
if let Some(t) = self.tokenizer.decode_rest()? {
print!("{t}");
std::io::stdout().flush()?;
}
break;
}
if let Some(t) = self.tokenizer.next_token(next_token)? {
Expand Down

0 comments on commit 74e9e41

Please sign in to comment.