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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -3
- data/examples/prompt_jp.txt +1 -1
- data/ext/llama_cpp/extconf.rb +1 -1
- data/ext/llama_cpp/llama_cpp.cpp +30 -0
- data/ext/llama_cpp/src/ggml-alloc.c +0 -5
- data/ext/llama_cpp/src/ggml-cuda.cu +1011 -655
- data/ext/llama_cpp/src/ggml-metal.m +57 -15
- data/ext/llama_cpp/src/ggml-metal.metal +271 -137
- data/ext/llama_cpp/src/ggml.c +7 -3
- data/ext/llama_cpp/src/ggml.h +1 -1
- data/ext/llama_cpp/src/k_quants.c +4 -1
- data/ext/llama_cpp/src/llama.cpp +617 -141
- data/ext/llama_cpp/src/llama.h +8 -6
- data/lib/llama_cpp/version.rb +2 -2
- data/lib/llama_cpp.rb +1 -1
- data/sig/llama_cpp.rbs +4 -0
- metadata +2 -2
data/ext/llama_cpp/src/llama.h
CHANGED
@@ -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
|
250
|
-
LLAMA_API int
|
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
|
256
|
-
LLAMA_API int
|
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);
|
data/lib/llama_cpp/version.rb
CHANGED
@@ -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.
|
6
|
+
VERSION = '0.5.2'
|
7
7
|
|
8
8
|
# The version of llama.cpp bundled with llama_cpp.rb.
|
9
|
-
LLAMA_CPP_VERSION = '
|
9
|
+
LLAMA_CPP_VERSION = 'b1'
|
10
10
|
end
|
data/lib/llama_cpp.rb
CHANGED
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.
|
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-
|
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:
|