pub struct LlamaTimings { /* private fields */ }
Expand description
A wrapper around llama_timings
.
Implementations§
Source§impl LlamaTimings
impl LlamaTimings
Sourcepub fn new(
t_start_ms: f64,
t_load_ms: f64,
t_p_eval_ms: f64,
t_eval_ms: f64,
n_p_eval: i32,
n_eval: i32,
) -> Self
pub fn new( t_start_ms: f64, t_load_ms: f64, t_p_eval_ms: f64, t_eval_ms: f64, n_p_eval: i32, n_eval: i32, ) -> Self
Create a new LlamaTimings
.
let timings = LlamaTimings::new(1.0, 2.0, 3.0, 4.0, 5, 6);
let timings_str = "load time = 2.00 ms
prompt eval time = 3.00 ms / 5 tokens (0.60 ms per token, 1666.67 tokens per second)
eval time = 4.00 ms / 6 runs (0.67 ms per token, 1500.00 tokens per second)\n";
assert_eq!(timings_str, format!("{}", timings));
Sourcepub fn t_start_ms(&self) -> f64
pub fn t_start_ms(&self) -> f64
Get the start time in milliseconds.
Sourcepub fn t_p_eval_ms(&self) -> f64
pub fn t_p_eval_ms(&self) -> f64
Get the prompt evaluation time in milliseconds.
Sourcepub fn set_t_start_ms(&mut self, t_start_ms: f64)
pub fn set_t_start_ms(&mut self, t_start_ms: f64)
Set the start time in milliseconds.
Sourcepub fn set_t_load_ms(&mut self, t_load_ms: f64)
pub fn set_t_load_ms(&mut self, t_load_ms: f64)
Set the load time in milliseconds.
Sourcepub fn set_t_p_eval_ms(&mut self, t_p_eval_ms: f64)
pub fn set_t_p_eval_ms(&mut self, t_p_eval_ms: f64)
Set the prompt evaluation time in milliseconds.
Sourcepub fn set_t_eval_ms(&mut self, t_eval_ms: f64)
pub fn set_t_eval_ms(&mut self, t_eval_ms: f64)
Set the evaluation time in milliseconds.
Sourcepub fn set_n_p_eval(&mut self, n_p_eval: i32)
pub fn set_n_p_eval(&mut self, n_p_eval: i32)
Set the number of prompt evaluations.
Sourcepub fn set_n_eval(&mut self, n_eval: i32)
pub fn set_n_eval(&mut self, n_eval: i32)
Set the number of evaluations.
Trait Implementations§
Source§impl Clone for LlamaTimings
impl Clone for LlamaTimings
Source§fn clone(&self) -> LlamaTimings
fn clone(&self) -> LlamaTimings
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LlamaTimings
impl Debug for LlamaTimings
Source§impl Display for LlamaTimings
impl Display for LlamaTimings
impl Copy for LlamaTimings
Auto Trait Implementations§
impl Freeze for LlamaTimings
impl RefUnwindSafe for LlamaTimings
impl Send for LlamaTimings
impl Sync for LlamaTimings
impl Unpin for LlamaTimings
impl UnwindSafe for LlamaTimings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more