File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,8 @@ def __init__(
205
205
model_path : str ,
206
206
# NOTE: These parameters are likely to change in the future.
207
207
n_ctx : int = 512 ,
208
+ rope_freq_base : float = 10000.0 ,
209
+ rope_freq_scale : float = 1.0 ,
208
210
n_parts : int = - 1 ,
209
211
n_gpu_layers : int = 0 ,
210
212
seed : int = 1337 ,
@@ -228,6 +230,8 @@ def __init__(
228
230
Args:
229
231
model_path: Path to the model.
230
232
n_ctx: Maximum context size.
233
+ rope_freq_base: RoPE base frequency.
234
+ rope_freq_scale: RoPE frequency scale.
231
235
n_parts: Number of parts to split the model into. If -1, the number of parts is automatically determined.
232
236
seed: Random seed. -1 for random.
233
237
f16_kv: Use half-precision for key/value cache.
@@ -256,6 +260,8 @@ def __init__(
256
260
257
261
self .params = llama_cpp .llama_context_default_params ()
258
262
self .params .n_ctx = n_ctx
263
+ self .params .rope_freq_base = rope_freq_base
264
+ self .params .rope_freq_scale = rope_freq_scale
259
265
self .params .n_gpu_layers = n_gpu_layers
260
266
self .params .seed = seed
261
267
self .params .f16_kv = f16_kv
Original file line number Diff line number Diff line change @@ -188,6 +188,8 @@ class llama_context_params(Structure):
188
188
_fields_ = [
189
189
("seed" , c_uint32 ),
190
190
("n_ctx" , c_int32 ),
191
+ ("rope_freq_base" , c_float ),
192
+ ("rope_freq_scale" , c_float ),
191
193
("n_batch" , c_int32 ),
192
194
("n_gpu_layers" , c_int32 ),
193
195
("main_gpu" , c_int32 ),
You can’t perform that action at this time.
0 commit comments