llama_cpp 0.14.2 → 0.14.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -388,6 +388,7 @@ extern "C" {
388
388
  LLAMA_API int32_t llama_n_vocab (const struct llama_model * model);
389
389
  LLAMA_API int32_t llama_n_ctx_train(const struct llama_model * model);
390
390
  LLAMA_API int32_t llama_n_embd (const struct llama_model * model);
391
+ LLAMA_API int32_t llama_n_layer (const struct llama_model * model);
391
392
 
392
393
  // Get the model's RoPE frequency scaling factor
393
394
  LLAMA_API float llama_rope_freq_scale_train(const struct llama_model * model);
@@ -435,10 +436,24 @@ extern "C" {
435
436
  // Returns 0 on success
436
437
  LLAMA_API int32_t llama_model_apply_lora_from_file(
437
438
  const struct llama_model * model,
438
- const char * path_lora,
439
- float scale,
440
- const char * path_base_model,
441
- int32_t n_threads);
439
+ const char * path_lora,
440
+ float scale,
441
+ const char * path_base_model,
442
+ int32_t n_threads);
443
+
444
+ // Apply a loaded control vector to a llama_context, or if data is NULL, clear
445
+ // the currently loaded vector.
446
+ // n_embd should be the size of a single layer's control, and data should point
447
+ // to an n_embd x n_layers buffer starting from layer 1.
448
+ // il_start and il_end are the layer range the vector should apply to (both inclusive)
449
+ // See llama_control_vector_load in common to load a control vector.
450
+ LLAMA_API int32_t llama_control_vector_apply(
451
+ struct llama_context * lctx,
452
+ const float * data,
453
+ size_t len,
454
+ int32_t n_embd,
455
+ int32_t il_start,
456
+ int32_t il_end);
442
457
 
443
458
  //
444
459
  // KV cache
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llama_cpp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-16 00:00:00.000000000 Z
11
+ date: 2024-03-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: llama_cpp.rb provides Ruby bindings for the llama.cpp.
14
14
  email:
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 3.4.19
96
+ rubygems_version: 3.5.3
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Ruby bindings for the llama.cpp.