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 {
669669 self . context_params . swa_full
670670 }
671671
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)
673689 ///
674690 /// # Examples
675691 ///
676692 /// ```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
677702 /// use llama_cpp_2::context::params::{LlamaContextParams, KvCacheType};
678703 /// let params = LlamaContextParams::default().with_type_k(KvCacheType::Q4_0);
679704 /// assert_eq!(params.type_k(), KvCacheType::Q4_0);
You can’t perform that action at this time.
0 commit comments