File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -544,6 +544,36 @@ impl LlamaContextParams {
544
544
pub fn swa_full ( & self ) -> bool {
545
545
self . context_params . swa_full
546
546
}
547
+
548
+ /// Set the max number of sequences (i.e. distinct states for recurrent models)
549
+ ///
550
+ /// # Examples
551
+ ///
552
+ /// ```rust
553
+ /// use llama_cpp_2::context::params::LlamaContextParams;
554
+ /// let params = LlamaContextParams::default()
555
+ /// .with_n_seq_max(64);
556
+ /// assert_eq!(params.n_seq_max(), 64);
557
+ /// ```
558
+ #[ must_use]
559
+ pub fn with_n_seq_max ( mut self , n_seq_max : u32 ) -> Self {
560
+ self . context_params . n_seq_max = n_seq_max;
561
+ self
562
+ }
563
+
564
+ /// Get the max number of sequences (i.e. distinct states for recurrent models)
565
+ ///
566
+ /// # Examples
567
+ ///
568
+ /// ```rust
569
+ /// use llama_cpp_2::context::params::LlamaContextParams;
570
+ /// let params = LlamaContextParams::default();
571
+ /// assert_eq!(params.n_seq_max(), 1);
572
+ /// ```
573
+ #[ must_use]
574
+ pub fn n_seq_max ( & self ) -> u32 {
575
+ self . context_params . n_seq_max
576
+ }
547
577
}
548
578
549
579
/// Default parameters for `LlamaContext`. (as defined in llama.cpp by `llama_context_default_params`)
You can’t perform that action at this time.
0 commit comments