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 @@ -514,6 +514,36 @@ impl LlamaContextParams {
514
514
pub fn pooling_type ( & self ) -> LlamaPoolingType {
515
515
LlamaPoolingType :: from ( self . context_params . pooling_type )
516
516
}
517
+
518
+ /// Set whether to use full sliding window attention
519
+ ///
520
+ /// # Examples
521
+ ///
522
+ /// ```rust
523
+ /// use llama_cpp_2::context::params::LlamaContextParams;
524
+ /// let params = LlamaContextParams::default()
525
+ /// .with_swa_full(false);
526
+ /// assert_eq!(params.swa_full(), false);
527
+ /// ```
528
+ #[ must_use]
529
+ pub fn with_swa_full ( mut self , enabled : bool ) -> Self {
530
+ self . context_params . swa_full = enabled;
531
+ self
532
+ }
533
+
534
+ /// Get whether full sliding window attention is enabled
535
+ ///
536
+ /// # Examples
537
+ ///
538
+ /// ```rust
539
+ /// use llama_cpp_2::context::params::LlamaContextParams;
540
+ /// let params = LlamaContextParams::default();
541
+ /// assert_eq!(params.swa_full(), true);
542
+ /// ```
543
+ #[ must_use]
544
+ pub fn swa_full ( & self ) -> bool {
545
+ self . context_params . swa_full
546
+ }
517
547
}
518
548
519
549
/// 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