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.
@@ -4,22 +4,56 @@
4
4
  #include <string>
5
5
  #include <vector>
6
6
 
7
- #define CODEPOINT_TYPE_UNIDENTIFIED 0
8
- #define CODEPOINT_TYPE_DIGIT 1
9
- #define CODEPOINT_TYPE_LETTER 2
10
- #define CODEPOINT_TYPE_WHITESPACE 3
11
- #define CODEPOINT_TYPE_ACCENT_MARK 4
12
- #define CODEPOINT_TYPE_PUNCTUATION 5
13
- #define CODEPOINT_TYPE_SYMBOL 6
14
- #define CODEPOINT_TYPE_CONTROL 7
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
- int unicode_cpt_type(uint32_t cp);
22
- int unicode_cpt_type(const std::string & utf8);
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.0
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-04 00:00:00.000000000 Z
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