llama_cpp 0.15.0 → 0.15.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 +12 -0
- data/ext/llama_cpp/llama_cpp.cpp +6 -0
- data/lib/llama_cpp/version.rb +2 -2
- data/sig/llama_cpp.rbs +6 -0
- data/vendor/tmp/llama.cpp/Makefile +6 -7
- data/vendor/tmp/llama.cpp/ggml-backend.c +2 -3
- data/vendor/tmp/llama.cpp/ggml-cuda.cu +303 -23
- data/vendor/tmp/llama.cpp/ggml-impl.h +84 -0
- data/vendor/tmp/llama.cpp/ggml-kompute.cpp +9 -3
- data/vendor/tmp/llama.cpp/ggml-metal.m +137 -133
- data/vendor/tmp/llama.cpp/ggml-metal.metal +87 -110
- data/vendor/tmp/llama.cpp/ggml-opencl.cpp +1 -0
- data/vendor/tmp/llama.cpp/ggml-quants.c +2220 -28
- data/vendor/tmp/llama.cpp/ggml-rpc.cpp +1032 -0
- data/vendor/tmp/llama.cpp/ggml-rpc.h +24 -0
- data/vendor/tmp/llama.cpp/ggml-sycl.cpp +35 -152
- data/vendor/tmp/llama.cpp/ggml-vulkan-shaders.hpp +46843 -39205
- data/vendor/tmp/llama.cpp/ggml-vulkan.cpp +953 -268
- data/vendor/tmp/llama.cpp/ggml.c +1762 -681
- data/vendor/tmp/llama.cpp/ggml.h +43 -24
- data/vendor/tmp/llama.cpp/llama.cpp +533 -296
- data/vendor/tmp/llama.cpp/llama.h +10 -1
- data/vendor/tmp/llama.cpp/sgemm.cpp +56 -21
- data/vendor/tmp/llama.cpp/unicode-data.cpp +6969 -1637
- data/vendor/tmp/llama.cpp/unicode-data.h +15 -11
- data/vendor/tmp/llama.cpp/unicode.cpp +286 -176
- data/vendor/tmp/llama.cpp/unicode.h +44 -10
- metadata +4 -2
@@ -4,22 +4,56 @@
|
|
4
4
|
#include <string>
|
5
5
|
#include <vector>
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
struct codepoint_flags {
|
8
|
+
enum {
|
9
|
+
UNDEFINED = 0x0001,
|
10
|
+
NUMBER = 0x0002, // regex: \p{N}
|
11
|
+
LETTER = 0x0004, // regex: \p{L}
|
12
|
+
SEPARATOR = 0x0008, // regex: \p{Z}
|
13
|
+
ACCENT_MARK = 0x0010, // regex: \p{M}
|
14
|
+
PUNCTUATION = 0x0020, // regex: \p{P}
|
15
|
+
SYMBOL = 0x0040, // regex: \p{S}
|
16
|
+
CONTROL = 0x0080, // regex: \p{C}
|
17
|
+
MASK_CATEGORIES = 0x00FF,
|
18
|
+
};
|
19
|
+
|
20
|
+
// codepoint type
|
21
|
+
uint16_t is_undefined : 1;
|
22
|
+
uint16_t is_number : 1; // regex: \p{N}
|
23
|
+
uint16_t is_letter : 1; // regex: \p{L}
|
24
|
+
uint16_t is_separator : 1; // regex: \p{Z}
|
25
|
+
uint16_t is_accent_mark : 1; // regex: \p{M}
|
26
|
+
uint16_t is_punctuation : 1; // regex: \p{P}
|
27
|
+
uint16_t is_symbol : 1; // regex: \p{S}
|
28
|
+
uint16_t is_control : 1; // regex: \p{C}
|
29
|
+
// helper flags
|
30
|
+
uint16_t is_whitespace : 1; // regex: \s
|
31
|
+
uint16_t is_lowercase : 1;
|
32
|
+
uint16_t is_uppercase : 1;
|
33
|
+
uint16_t is_nfd : 1;
|
34
|
+
|
35
|
+
// decode from uint16
|
36
|
+
inline codepoint_flags(const uint16_t flags=0) {
|
37
|
+
*reinterpret_cast<uint16_t*>(this) = flags;
|
38
|
+
}
|
39
|
+
|
40
|
+
inline uint16_t as_uint() const {
|
41
|
+
return *reinterpret_cast<const uint16_t*>(this);
|
42
|
+
}
|
43
|
+
|
44
|
+
inline uint16_t category_flag() const {
|
45
|
+
return this->as_uint() & MASK_CATEGORIES;
|
46
|
+
}
|
47
|
+
};
|
48
|
+
|
15
49
|
|
16
50
|
std::string unicode_cpt_to_utf8(uint32_t cp);
|
17
51
|
std::vector<uint32_t> unicode_cpts_from_utf8(const std::string & utf8);
|
18
52
|
|
19
53
|
std::vector<uint32_t> unicode_cpts_normalize_nfd(const std::vector<uint32_t> & cpts);
|
20
54
|
|
21
|
-
|
22
|
-
|
55
|
+
codepoint_flags unicode_cpt_flags(const uint32_t cp);
|
56
|
+
codepoint_flags unicode_cpt_flags(const std::string & utf8);
|
23
57
|
|
24
58
|
std::string unicode_byte_to_utf8(uint8_t byte);
|
25
59
|
uint8_t unicode_utf8_to_byte(const std::string & utf8);
|
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.15.
|
4
|
+
version: 0.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshoku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: llama_cpp.rb provides Ruby bindings for the llama.cpp.
|
14
14
|
email:
|
@@ -57,6 +57,8 @@ files:
|
|
57
57
|
- vendor/tmp/llama.cpp/ggml-opencl.h
|
58
58
|
- vendor/tmp/llama.cpp/ggml-quants.c
|
59
59
|
- vendor/tmp/llama.cpp/ggml-quants.h
|
60
|
+
- vendor/tmp/llama.cpp/ggml-rpc.cpp
|
61
|
+
- vendor/tmp/llama.cpp/ggml-rpc.h
|
60
62
|
- vendor/tmp/llama.cpp/ggml-sycl.cpp
|
61
63
|
- vendor/tmp/llama.cpp/ggml-sycl.h
|
62
64
|
- vendor/tmp/llama.cpp/ggml-vulkan-shaders.hpp
|