Add from_iter and arange, use it in the doctests. (#145)

This commit is contained in:
Laurent Mazare
2023-07-12 12:03:01 +01:00
committed by GitHub
parent b3b39cca92
commit 20599172ac
4 changed files with 39 additions and 6 deletions

View File

@ -209,7 +209,6 @@ fn main() -> Result<()> {
index_pos += ctxt.len();
let next_token = if let Some(temperature) = args.temperature {
println!("Sampling with temperature {temperature:?}");
let prs = (&logits / temperature)?.softmax(D::Minus1)?;
let logits_v: Vec<f32> = prs.to_vec1()?;
let distr = rand::distributions::WeightedIndex::new(&logits_v)?;