make up for the missing last token output of phi2 example (#2299)

This commit is contained in:
Czxck001
2024-06-29 12:34:42 -07:00
committed by GitHub
parent e27aac0a06
commit 74e9e41911

View File

@ -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)? {