llama_cpp 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -245,15 +245,17 @@ extern "C" {
245
245
  LLAMA_API bool llama_mmap_supported (void);
246
246
  LLAMA_API bool llama_mlock_supported(void);
247
247
 
248
- LLAMA_API int llama_n_vocab(const struct llama_context * ctx);
249
- LLAMA_API int llama_n_ctx (const struct llama_context * ctx);
250
- LLAMA_API int llama_n_embd (const struct llama_context * ctx);
248
+ LLAMA_API int llama_n_vocab (const struct llama_context * ctx);
249
+ LLAMA_API int llama_n_ctx (const struct llama_context * ctx);
250
+ LLAMA_API int llama_n_ctx_train(const struct llama_context * ctx);
251
+ LLAMA_API int llama_n_embd (const struct llama_context * ctx);
251
252
 
252
253
  LLAMA_API enum llama_vocab_type llama_vocab_type(const struct llama_context * ctx);
253
254
 
254
- LLAMA_API int llama_model_n_vocab(const struct llama_model * model);
255
- LLAMA_API int llama_model_n_ctx (const struct llama_model * model);
256
- LLAMA_API int llama_model_n_embd (const struct llama_model * model);
255
+ LLAMA_API int llama_model_n_vocab (const struct llama_model * model);
256
+ LLAMA_API int llama_model_n_ctx (const struct llama_model * model);
257
+ LLAMA_API int llama_model_n_ctx_train(const struct llama_model * model);
258
+ LLAMA_API int llama_model_n_embd (const struct llama_model * model);
257
259
 
258
260
  // Get a string describing the model type
259
261
  LLAMA_API int llama_model_desc(const struct llama_model * model, char * buf, size_t buf_size);
@@ -3,8 +3,8 @@
3
3
  # llama_cpp.rb provides Ruby bindings for the llama.cpp.
4
4
  module LLaMACpp
5
5
  # The version of llama_cpp.rb you install.
6
- VERSION = '0.5.1'
6
+ VERSION = '0.5.2'
7
7
 
8
8
  # The version of llama.cpp bundled with llama_cpp.rb.
9
- LLAMA_CPP_VERSION = 'b1198'
9
+ LLAMA_CPP_VERSION = 'b1'
10
10
  end
data/lib/llama_cpp.rb CHANGED
@@ -104,7 +104,7 @@ module LLaMACpp
104
104
  break if !embd.empty? && embd[-1] == context.token_eos
105
105
  end
106
106
 
107
- output.join.delete_prefix(spaced_prompt).strip
107
+ output.join.force_encoding('UTF-8').delete_prefix(spaced_prompt).strip
108
108
  end
109
109
  end
110
110
 
data/sig/llama_cpp.rbs CHANGED
@@ -75,6 +75,7 @@ module LLaMACpp
75
75
  def apply_lora_from_file: (lora_path: String, ?base_model_path: String, ?n_threads: Integer) -> void
76
76
  def n_vocab: () -> Integer
77
77
  def n_ctx: () -> Integer
78
+ def n_ctx_train: () -> Integer
78
79
  def n_embd: () -> Integer
79
80
  def token_to_piece: (Integer) -> String
80
81
  def tokenize: (text: String, ?n_max_tokens: Integer, ?add_bos: bool) -> Array[Integer]
@@ -113,6 +114,7 @@ module LLaMACpp
113
114
  def eval_export: (String) -> bool
114
115
  def logits: () -> Array[Float]
115
116
  def n_ctx: () -> Integer
117
+ def n_ctx_train: () -> Integer
116
118
  def n_embd: () -> Integer
117
119
  def n_vocab: () -> Integer
118
120
  def timings: () -> ::LLaMACpp::Timings
@@ -188,6 +190,8 @@ module LLaMACpp
188
190
  def allow_quantization=: (bool) -> bool
189
191
  def quantize_output_tensor: () -> bool
190
192
  def quantize_output_tensor=: (bool) -> bool
193
+ def only_copy: () -> bool
194
+ def only_copy=: (bool) -> bool
191
195
  end
192
196
 
193
197
  class Params = ContextParams
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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-08 00:00:00.000000000 Z
11
+ date: 2023-09-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: llama_cpp.rb provides Ruby bindings for the llama.cpp.
14
14
  email: