Skip to content

Commit

Permalink
fixed example v2
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusDunn committed Jan 3, 2024
1 parent d6dc6c1 commit f128500
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llama-cpp-2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//! let mut pos: i32 = 0;
//!
//! // add the prompt to the batch
//! let last_index = i32::try_from(tokens.len()).unwrap() - 1;
//! let last_index = i32::try_from(tokens.len())? - 1;
//! for token in tokens {
//! batch.add(token, pos, &[0], pos == last_index);
//! pos += 1;
Expand All @@ -47,8 +47,8 @@
//! let token = context.sample_token_greedy(LlamaTokenDataArray::from_iter(context.candidates_ith(batch.n_tokens()), false));
//! response.push(token);
//! batch.clear();
//! pos += 1;
//! batch.add(token, pos, &[0], true);
//! pos += 1;
//! }
//!
//! let response_str = model.tokens_to_str(&response)?;
Expand Down

0 comments on commit f128500

Please sign in to comment.