cui-llama.rn 1.4.0 → 1.4.1
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.
- package/android/src/main/jni.cpp +9 -9
- package/cpp/common.cpp +163 -60
- package/cpp/common.h +43 -12
- package/cpp/ggml-alloc.c +1042 -1037
- package/cpp/ggml-backend-impl.h +255 -256
- package/cpp/ggml-backend-reg.cpp +582 -582
- package/cpp/ggml-backend.cpp +2002 -2002
- package/cpp/ggml-backend.h +354 -352
- package/cpp/ggml-common.h +1853 -1853
- package/cpp/ggml-cpp.h +39 -39
- package/cpp/ggml-cpu-aarch64.cpp +4247 -4247
- package/cpp/ggml-cpu-aarch64.h +8 -8
- package/cpp/ggml-cpu-impl.h +386 -386
- package/cpp/ggml-cpu-quants.c +10920 -10839
- package/cpp/ggml-cpu-traits.cpp +36 -36
- package/cpp/ggml-cpu-traits.h +38 -38
- package/cpp/ggml-cpu.c +329 -60
- package/cpp/ggml-cpu.cpp +10 -2
- package/cpp/ggml-cpu.h +135 -135
- package/cpp/ggml-impl.h +567 -567
- package/cpp/ggml-metal-impl.h +17 -17
- package/cpp/ggml-metal.m +4884 -4884
- package/cpp/ggml-quants.c +5238 -5238
- package/cpp/ggml-threading.h +14 -14
- package/cpp/ggml.c +6514 -6448
- package/cpp/ggml.h +2194 -2163
- package/cpp/gguf.cpp +1329 -1325
- package/cpp/gguf.h +202 -202
- package/cpp/json-schema-to-grammar.cpp +1045 -1045
- package/cpp/json-schema-to-grammar.h +8 -8
- package/cpp/json.hpp +24766 -24766
- package/cpp/llama-adapter.cpp +347 -346
- package/cpp/llama-adapter.h +74 -73
- package/cpp/llama-arch.cpp +1487 -1434
- package/cpp/llama-arch.h +400 -395
- package/cpp/llama-batch.cpp +368 -368
- package/cpp/llama-batch.h +88 -88
- package/cpp/llama-chat.cpp +578 -567
- package/cpp/llama-chat.h +52 -51
- package/cpp/llama-context.cpp +1775 -1771
- package/cpp/llama-context.h +128 -128
- package/cpp/llama-cparams.cpp +1 -1
- package/cpp/llama-cparams.h +37 -37
- package/cpp/llama-cpp.h +30 -30
- package/cpp/llama-grammar.cpp +1139 -1139
- package/cpp/llama-grammar.h +143 -143
- package/cpp/llama-hparams.cpp +71 -71
- package/cpp/llama-hparams.h +139 -140
- package/cpp/llama-impl.cpp +167 -167
- package/cpp/llama-impl.h +61 -61
- package/cpp/llama-kv-cache.cpp +718 -718
- package/cpp/llama-kv-cache.h +218 -218
- package/cpp/llama-mmap.cpp +2 -1
- package/cpp/llama-mmap.h +67 -67
- package/cpp/llama-model-loader.cpp +1124 -1011
- package/cpp/llama-model-loader.h +167 -158
- package/cpp/llama-model.cpp +3997 -2202
- package/cpp/llama-model.h +370 -391
- package/cpp/llama-sampling.cpp +2408 -2406
- package/cpp/llama-sampling.h +32 -48
- package/cpp/llama-vocab.cpp +3247 -1982
- package/cpp/llama-vocab.h +125 -182
- package/cpp/llama.cpp +416 -2886
- package/cpp/llama.h +1323 -1285
- package/cpp/log.cpp +401 -401
- package/cpp/log.h +121 -121
- package/cpp/rn-llama.hpp +18 -12
- package/cpp/sampling.cpp +505 -500
- package/cpp/sgemm.cpp +2597 -2597
- package/cpp/speculative.cpp +277 -274
- package/cpp/speculative.h +28 -28
- package/cpp/unicode.cpp +2 -3
- package/package.json +1 -1
package/cpp/ggml-cpp.h
CHANGED
@@ -1,39 +1,39 @@
|
|
1
|
-
#pragma once
|
2
|
-
|
3
|
-
#ifndef __cplusplus
|
4
|
-
#error "This header is for C++ only"
|
5
|
-
#endif
|
6
|
-
|
7
|
-
#include "ggml.h"
|
8
|
-
#include "ggml-alloc.h"
|
9
|
-
#include "ggml-backend.h"
|
10
|
-
#include "gguf.h"
|
11
|
-
#include <memory>
|
12
|
-
|
13
|
-
// Smart pointers for ggml types
|
14
|
-
|
15
|
-
// ggml
|
16
|
-
|
17
|
-
struct lm_ggml_context_deleter { void operator()(lm_ggml_context * ctx) { lm_ggml_free(ctx); } };
|
18
|
-
struct lm_gguf_context_deleter { void operator()(lm_gguf_context * ctx) { lm_gguf_free(ctx); } };
|
19
|
-
|
20
|
-
typedef std::unique_ptr<lm_ggml_context, lm_ggml_context_deleter> lm_ggml_context_ptr;
|
21
|
-
typedef std::unique_ptr<lm_gguf_context, lm_gguf_context_deleter> lm_gguf_context_ptr;
|
22
|
-
|
23
|
-
// ggml-alloc
|
24
|
-
|
25
|
-
struct lm_ggml_gallocr_deleter { void operator()(lm_ggml_gallocr_t galloc) { lm_ggml_gallocr_free(galloc); } };
|
26
|
-
|
27
|
-
typedef std::unique_ptr<lm_ggml_gallocr_t, lm_ggml_gallocr_deleter> lm_ggml_gallocr_ptr;
|
28
|
-
|
29
|
-
// ggml-backend
|
30
|
-
|
31
|
-
struct lm_ggml_backend_deleter { void operator()(lm_ggml_backend_t backend) { lm_ggml_backend_free(backend); } };
|
32
|
-
struct lm_ggml_backend_buffer_deleter { void operator()(lm_ggml_backend_buffer_t buffer) { lm_ggml_backend_buffer_free(buffer); } };
|
33
|
-
struct lm_ggml_backend_event_deleter { void operator()(lm_ggml_backend_event_t event) { lm_ggml_backend_event_free(event); } };
|
34
|
-
struct lm_ggml_backend_sched_deleter { void operator()(lm_ggml_backend_sched_t sched) { lm_ggml_backend_sched_free(sched); } };
|
35
|
-
|
36
|
-
typedef std::unique_ptr<lm_ggml_backend, lm_ggml_backend_deleter> lm_ggml_backend_ptr;
|
37
|
-
typedef std::unique_ptr<lm_ggml_backend_buffer, lm_ggml_backend_buffer_deleter> lm_ggml_backend_buffer_ptr;
|
38
|
-
typedef std::unique_ptr<lm_ggml_backend_event, lm_ggml_backend_event_deleter> lm_ggml_backend_event_ptr;
|
39
|
-
typedef std::unique_ptr<lm_ggml_backend_sched, lm_ggml_backend_sched_deleter> lm_ggml_backend_sched_ptr;
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#ifndef __cplusplus
|
4
|
+
#error "This header is for C++ only"
|
5
|
+
#endif
|
6
|
+
|
7
|
+
#include "ggml.h"
|
8
|
+
#include "ggml-alloc.h"
|
9
|
+
#include "ggml-backend.h"
|
10
|
+
#include "gguf.h"
|
11
|
+
#include <memory>
|
12
|
+
|
13
|
+
// Smart pointers for ggml types
|
14
|
+
|
15
|
+
// ggml
|
16
|
+
|
17
|
+
struct lm_ggml_context_deleter { void operator()(lm_ggml_context * ctx) { lm_ggml_free(ctx); } };
|
18
|
+
struct lm_gguf_context_deleter { void operator()(lm_gguf_context * ctx) { lm_gguf_free(ctx); } };
|
19
|
+
|
20
|
+
typedef std::unique_ptr<lm_ggml_context, lm_ggml_context_deleter> lm_ggml_context_ptr;
|
21
|
+
typedef std::unique_ptr<lm_gguf_context, lm_gguf_context_deleter> lm_gguf_context_ptr;
|
22
|
+
|
23
|
+
// ggml-alloc
|
24
|
+
|
25
|
+
struct lm_ggml_gallocr_deleter { void operator()(lm_ggml_gallocr_t galloc) { lm_ggml_gallocr_free(galloc); } };
|
26
|
+
|
27
|
+
typedef std::unique_ptr<lm_ggml_gallocr_t, lm_ggml_gallocr_deleter> lm_ggml_gallocr_ptr;
|
28
|
+
|
29
|
+
// ggml-backend
|
30
|
+
|
31
|
+
struct lm_ggml_backend_deleter { void operator()(lm_ggml_backend_t backend) { lm_ggml_backend_free(backend); } };
|
32
|
+
struct lm_ggml_backend_buffer_deleter { void operator()(lm_ggml_backend_buffer_t buffer) { lm_ggml_backend_buffer_free(buffer); } };
|
33
|
+
struct lm_ggml_backend_event_deleter { void operator()(lm_ggml_backend_event_t event) { lm_ggml_backend_event_free(event); } };
|
34
|
+
struct lm_ggml_backend_sched_deleter { void operator()(lm_ggml_backend_sched_t sched) { lm_ggml_backend_sched_free(sched); } };
|
35
|
+
|
36
|
+
typedef std::unique_ptr<lm_ggml_backend, lm_ggml_backend_deleter> lm_ggml_backend_ptr;
|
37
|
+
typedef std::unique_ptr<lm_ggml_backend_buffer, lm_ggml_backend_buffer_deleter> lm_ggml_backend_buffer_ptr;
|
38
|
+
typedef std::unique_ptr<lm_ggml_backend_event, lm_ggml_backend_event_deleter> lm_ggml_backend_event_ptr;
|
39
|
+
typedef std::unique_ptr<lm_ggml_backend_sched, lm_ggml_backend_sched_deleter> lm_ggml_backend_sched_ptr;
|