@@ -84,7 +84,8 @@ impl LlamaContextParams {
8484 /// let params = params.with_seed(1234);
8585 /// assert_eq!(params.seed(), 1234);
8686 /// ```
87- #[ must_use] pub fn with_seed ( mut self , seed : u32 ) -> Self {
87+ #[ must_use]
88+ pub fn with_seed ( mut self , seed : u32 ) -> Self {
8889 self . context_params . seed = seed;
8990 self
9091 }
@@ -99,7 +100,8 @@ impl LlamaContextParams {
99100 /// .with_seed(1234);
100101 /// assert_eq!(params.seed(), 1234);
101102 /// ```
102- #[ must_use] pub fn seed ( & self ) -> u32 {
103+ #[ must_use]
104+ pub fn seed ( & self ) -> u32 {
103105 self . context_params . seed
104106 }
105107
@@ -114,7 +116,8 @@ impl LlamaContextParams {
114116 /// let params = params.with_n_ctx(NonZeroU32::new(2048));
115117 /// assert_eq!(params.n_ctx(), NonZeroU32::new(2048));
116118 /// ```
117- #[ must_use] pub fn with_n_ctx ( mut self , n_ctx : Option < NonZeroU32 > ) -> Self {
119+ #[ must_use]
120+ pub fn with_n_ctx ( mut self , n_ctx : Option < NonZeroU32 > ) -> Self {
118121 self . context_params . n_ctx = n_ctx. map_or ( 0 , std:: num:: NonZeroU32 :: get) ;
119122 self
120123 }
@@ -128,7 +131,8 @@ impl LlamaContextParams {
128131 /// ```rust
129132 /// let params = llama_cpp_2::context::params::LlamaContextParams::default();
130133 /// assert_eq!(params.n_ctx(), std::num::NonZeroU32::new(512));
131- #[ must_use] pub fn n_ctx ( & self ) -> Option < NonZeroU32 > {
134+ #[ must_use]
135+ pub fn n_ctx ( & self ) -> Option < NonZeroU32 > {
132136 NonZeroU32 :: new ( self . context_params . n_ctx )
133137 }
134138
@@ -143,7 +147,8 @@ impl LlamaContextParams {
143147 /// .with_n_batch(2048);
144148 /// assert_eq!(params.n_batch(), 2048);
145149 /// ```
146- #[ must_use] pub fn with_n_batch ( mut self , n_batch : u32 ) -> Self {
150+ #[ must_use]
151+ pub fn with_n_batch ( mut self , n_batch : u32 ) -> Self {
147152 self . context_params . n_batch = n_batch;
148153 self
149154 }
@@ -157,7 +162,8 @@ impl LlamaContextParams {
157162 /// let params = LlamaContextParams::default();
158163 /// assert_eq!(params.n_batch(), 512);
159164 /// ```
160- #[ must_use] pub fn n_batch ( & self ) -> u32 {
165+ #[ must_use]
166+ pub fn n_batch ( & self ) -> u32 {
161167 self . context_params . n_batch
162168 }
163169
@@ -171,7 +177,8 @@ impl LlamaContextParams {
171177 /// .with_rope_scaling_type(RopeScalingType::Linear);
172178 /// assert_eq!(params.rope_scaling_type(), RopeScalingType::Linear);
173179 /// ```
174- #[ must_use] pub fn with_rope_scaling_type ( mut self , rope_scaling_type : RopeScalingType ) -> Self {
180+ #[ must_use]
181+ pub fn with_rope_scaling_type ( mut self , rope_scaling_type : RopeScalingType ) -> Self {
175182 self . context_params . rope_scaling_type = i32:: from ( rope_scaling_type) ;
176183 self
177184 }
@@ -184,7 +191,8 @@ impl LlamaContextParams {
184191 /// let params = llama_cpp_2::context::params::LlamaContextParams::default();
185192 /// assert_eq!(params.rope_scaling_type(), llama_cpp_2::context::params::RopeScalingType::Unspecified);
186193 /// ```
187- #[ must_use] pub fn rope_scaling_type ( & self ) -> RopeScalingType {
194+ #[ must_use]
195+ pub fn rope_scaling_type ( & self ) -> RopeScalingType {
188196 RopeScalingType :: from ( self . context_params . rope_scaling_type )
189197 }
190198
@@ -198,7 +206,8 @@ impl LlamaContextParams {
198206 /// .with_rope_freq_base(0.5);
199207 /// assert_eq!(params.rope_freq_base(), 0.5);
200208 /// ```
201- #[ must_use] pub fn with_rope_freq_base ( mut self , rope_freq_base : f32 ) -> Self {
209+ #[ must_use]
210+ pub fn with_rope_freq_base ( mut self , rope_freq_base : f32 ) -> Self {
202211 self . context_params . rope_freq_base = rope_freq_base;
203212 self
204213 }
@@ -211,7 +220,8 @@ impl LlamaContextParams {
211220 /// let params = llama_cpp_2::context::params::LlamaContextParams::default();
212221 /// assert_eq!(params.rope_freq_base(), 0.0);
213222 /// ```
214- #[ must_use] pub fn rope_freq_base ( & self ) -> f32 {
223+ #[ must_use]
224+ pub fn rope_freq_base ( & self ) -> f32 {
215225 self . context_params . rope_freq_base
216226 }
217227
@@ -225,7 +235,8 @@ impl LlamaContextParams {
225235 /// .with_rope_freq_scale(0.5);
226236 /// assert_eq!(params.rope_freq_scale(), 0.5);
227237 /// ```
228- #[ must_use] pub fn with_rope_freq_scale ( mut self , rope_freq_scale : f32 ) -> Self {
238+ #[ must_use]
239+ pub fn with_rope_freq_scale ( mut self , rope_freq_scale : f32 ) -> Self {
229240 self . context_params . rope_freq_scale = rope_freq_scale;
230241 self
231242 }
@@ -238,7 +249,8 @@ impl LlamaContextParams {
238249 /// let params = llama_cpp_2::context::params::LlamaContextParams::default();
239250 /// assert_eq!(params.rope_freq_scale(), 0.0);
240251 /// ```
241- #[ must_use] pub fn rope_freq_scale ( & self ) -> f32 {
252+ #[ must_use]
253+ pub fn rope_freq_scale ( & self ) -> f32 {
242254 self . context_params . rope_freq_scale
243255 }
244256
@@ -250,7 +262,8 @@ impl LlamaContextParams {
250262 /// let params = llama_cpp_2::context::params::LlamaContextParams::default();
251263 /// assert_eq!(params.n_threads(), 4);
252264 /// ```
253- #[ must_use] pub fn n_threads ( & self ) -> u32 {
265+ #[ must_use]
266+ pub fn n_threads ( & self ) -> u32 {
254267 self . context_params . n_threads
255268 }
256269
@@ -264,7 +277,8 @@ impl LlamaContextParams {
264277 /// .with_n_threads(8);
265278 /// assert_eq!(params.n_threads(), 8);
266279 /// ```
267- #[ must_use] pub fn with_n_threads ( mut self , n_threads : u32 ) -> Self {
280+ #[ must_use]
281+ pub fn with_n_threads ( mut self , n_threads : u32 ) -> Self {
268282 self . context_params . n_threads = n_threads;
269283 self
270284 }
0 commit comments