File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -669,11 +669,36 @@ impl LlamaContextParams {
669
669
self . context_params . swa_full
670
670
}
671
671
672
- /// Set the KV cache data type for K
672
+ /// Set the max number of sequences (i.e. distinct states for recurrent models)
673
+ ///
674
+ /// # Examples
675
+ ///
676
+ /// ```rust
677
+ /// use llama_cpp_2::context::params::LlamaContextParams;
678
+ /// let params = LlamaContextParams::default()
679
+ /// .with_n_seq_max(64);
680
+ /// assert_eq!(params.n_seq_max(), 64);
681
+ /// ```
682
+ #[ must_use]
683
+ pub fn with_n_seq_max ( mut self , n_seq_max : u32 ) -> Self {
684
+ self . context_params . n_seq_max = n_seq_max;
685
+ self
686
+ }
687
+
688
+ /// Get the max number of sequences (i.e. distinct states for recurrent models)
673
689
///
674
690
/// # Examples
675
691
///
676
692
/// ```rust
693
+ /// use llama_cpp_2::context::params::LlamaContextParams;
694
+ /// let params = LlamaContextParams::default();
695
+ /// assert_eq!(params.n_seq_max(), 1);
696
+ /// ```
697
+ #[ must_use]
698
+ pub fn n_seq_max ( & self ) -> u32 {
699
+ self . context_params . n_seq_max
700
+ }
701
+ /// Set the KV cache data type for K
677
702
/// use llama_cpp_2::context::params::{LlamaContextParams, KvCacheType};
678
703
/// let params = LlamaContextParams::default().with_type_k(KvCacheType::Q4_0);
679
704
/// assert_eq!(params.type_k(), KvCacheType::Q4_0);
You can’t perform that action at this time.
0 commit comments