mirror of
https://github.com/huggingface/candle.git
synced 2025-06-18 03:28:50 +00:00
make up for the missing last token output of phi2 example (#2299)
This commit is contained in:
@ -114,6 +114,10 @@ impl TextGeneration {
|
|||||||
tokens.push(next_token);
|
tokens.push(next_token);
|
||||||
generated_tokens += 1;
|
generated_tokens += 1;
|
||||||
if next_token == eos_token {
|
if next_token == eos_token {
|
||||||
|
if let Some(t) = self.tokenizer.decode_rest()? {
|
||||||
|
print!("{t}");
|
||||||
|
std::io::stdout().flush()?;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if let Some(t) = self.tokenizer.next_token(next_token)? {
|
if let Some(t) = self.tokenizer.next_token(next_token)? {
|
||||||
|
Reference in New Issue
Block a user