llama-cpp-capacitor 0.0.13 → 0.0.21
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/LlamaCpp.podspec +17 -17
- package/Package.swift +27 -27
- package/README.md +717 -574
- package/android/build.gradle +88 -69
- package/android/src/main/AndroidManifest.xml +2 -2
- package/android/src/main/CMakeLists-arm64.txt +131 -0
- package/android/src/main/CMakeLists-x86_64.txt +135 -0
- package/android/src/main/CMakeLists.txt +35 -52
- package/android/src/main/java/ai/annadata/plugin/capacitor/LlamaCpp.java +956 -717
- package/android/src/main/java/ai/annadata/plugin/capacitor/LlamaCppPlugin.java +710 -590
- package/android/src/main/jni-utils.h +7 -7
- package/android/src/main/jni.cpp +868 -127
- package/cpp/{rn-completion.cpp → cap-completion.cpp} +202 -24
- package/cpp/{rn-completion.h → cap-completion.h} +22 -11
- package/cpp/{rn-llama.cpp → cap-llama.cpp} +81 -27
- package/cpp/{rn-llama.h → cap-llama.h} +32 -20
- package/cpp/{rn-mtmd.hpp → cap-mtmd.hpp} +15 -15
- package/cpp/{rn-tts.cpp → cap-tts.cpp} +12 -12
- package/cpp/{rn-tts.h → cap-tts.h} +14 -14
- package/cpp/ggml-cpu/ggml-cpu-impl.h +30 -0
- package/dist/docs.json +100 -3
- package/dist/esm/definitions.d.ts +45 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +22 -0
- package/dist/esm/index.js +66 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/plugin.cjs.js +71 -3
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +71 -3
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/LlamaCppPlugin/LlamaCpp.swift +596 -596
- package/ios/Sources/LlamaCppPlugin/LlamaCppPlugin.swift +591 -514
- package/ios/Tests/LlamaCppPluginTests/LlamaCppPluginTests.swift +15 -15
- package/package.json +111 -110
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#include <jni.h>
|
|
5
5
|
#include <string>
|
|
6
6
|
#include <vector>
|
|
7
|
-
#include "
|
|
7
|
+
#include "cap-llama.h"
|
|
8
8
|
|
|
9
9
|
namespace jni_utils {
|
|
10
10
|
|
|
@@ -86,14 +86,14 @@ void set_static_field(JNIEnv* env, jclass clazz, jfieldID field, ...);
|
|
|
86
86
|
// Get static field safely
|
|
87
87
|
jobject get_static_field(JNIEnv* env, jclass clazz, jfieldID field);
|
|
88
88
|
|
|
89
|
-
// Convert
|
|
90
|
-
jobject llama_context_to_jobject(JNIEnv* env, const
|
|
89
|
+
// Convert llama_cap_context to jobject
|
|
90
|
+
jobject llama_context_to_jobject(JNIEnv* env, const capllama::llama_cap_context* context);
|
|
91
91
|
|
|
92
|
-
// Convert jobject to
|
|
93
|
-
|
|
92
|
+
// Convert jobject to llama_cap_context
|
|
93
|
+
capllama::llama_cap_context* jobject_to_llama_context(JNIEnv* env, jobject obj);
|
|
94
94
|
|
|
95
95
|
// Convert completion result to jobject
|
|
96
|
-
jobject completion_result_to_jobject(JNIEnv* env, const
|
|
96
|
+
jobject completion_result_to_jobject(JNIEnv* env, const capllama::completion_token_output& result);
|
|
97
97
|
|
|
98
98
|
// Convert jobject to completion parameters
|
|
99
99
|
common_params jobject_to_completion_params(JNIEnv* env, jobject obj);
|
|
@@ -105,7 +105,7 @@ jobject chat_params_to_jobject(JNIEnv* env, const common_chat_params& params);
|
|
|
105
105
|
common_chat_params jobject_to_chat_params(JNIEnv* env, jobject obj);
|
|
106
106
|
|
|
107
107
|
// Convert tokenize result to jobject
|
|
108
|
-
jobject tokenize_result_to_jobject(JNIEnv* env, const
|
|
108
|
+
jobject tokenize_result_to_jobject(JNIEnv* env, const capllama::llama_cap_tokenize_result& result);
|
|
109
109
|
|
|
110
110
|
// Convert embedding result to jobject
|
|
111
111
|
jobject embedding_result_to_jobject(JNIEnv* env, const std::vector<float>& embedding);
|