Fix the eos token for gemma. (#1753)

This commit is contained in:
Laurent Mazare
2024-02-24 11:07:02 +01:00
committed by GitHub
parent eeb7e2b683
commit 8d04f70f4d

View File

@ -66,9 +66,9 @@ impl TextGeneration {
std::io::stdout().flush()?; std::io::stdout().flush()?;
let mut generated_tokens = 0usize; let mut generated_tokens = 0usize;
let eos_token = match self.tokenizer.get_token("</s>") { let eos_token = match self.tokenizer.get_token("<eos>") {
Some(token) => token, Some(token) => token,
None => anyhow::bail!("cannot find the </s> token"), None => anyhow::bail!("cannot find the <eos> token"),
}; };
let start_gen = std::time::Instant::now(); let start_gen = std::time::Instant::now();
for index in 0..sample_len { for index in 0..sample_len {