Skip to content

Commit

Permalink
Merge pull request rustformers#66 from jempabroni/main
Browse files Browse the repository at this point in the history
Import fixes for magic and fix 65B model
  • Loading branch information
setzer22 authored Mar 23, 2023
2 parents a1122dd + 79a0359 commit bf7bdbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion llama-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,9 @@ impl Model {
f16_: _,
} = self.hparams;

let mut buf_size = 512 * 1024 * 1024;
// For the first run, we need to guess a maximum buffer size so we can measure
// the actual memory consumption of the temporary ggml context.
let mut buf_size = 1024 * 1024 * 1024;
if session.mem_per_token > 0 && session.mem_per_token * n > buf_size {
// add 10% to account for ggml object overhead
buf_size = (1.1f64 * session.mem_per_token as f64 * n as f64) as usize;
Expand Down

0 comments on commit bf7bdbc

Please sign in to comment.