llama_cpp 0.5.1 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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);
@@ -372,6 +374,7 @@ extern "C" {
372
374
  LLAMA_API int llama_tokenize(
373
375
  struct llama_context * ctx,
374
376
  const char * text,
377
+ int text_len,
375
378
  llama_token * tokens,
376
379
  int n_max_tokens,
377
380
  bool add_bos);
@@ -379,6 +382,7 @@ extern "C" {
379
382
  LLAMA_API int llama_tokenize_with_model(
380
383
  const struct llama_model * model,
381
384
  const char * text,
385
+ int text_len,
382
386
  llama_token * tokens,
383
387
  int n_max_tokens,
384
388
  bool add_bos);
@@ -538,7 +542,9 @@ extern "C" {
538
542
 
539
543
  struct ggml_tensor;
540
544
 
541
- const std::vector<std::pair<std::string, struct ggml_tensor *>>& llama_internal_get_tensor_map(struct llama_context * ctx);
545
+ const std::vector<std::pair<std::string, struct ggml_tensor *>> & llama_internal_get_tensor_map(
546
+ struct llama_context * ctx
547
+ );
542
548
 
543
549
  #endif // LLAMA_API_INTERNAL
544
550
 
@@ -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.3'
7
7
 
8
8
  # The version of llama.cpp bundled with llama_cpp.rb.
9
- LLAMA_CPP_VERSION = 'b1198'
9
+ LLAMA_CPP_VERSION = 'b1266'
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.3
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-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: llama_cpp.rb provides Ruby bindings for the llama.cpp.
14
14
  email: