cui-llama.rn 1.0.7 → 1.0.9

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/cpp/llama.h CHANGED
@@ -345,7 +345,7 @@ extern "C" {
345
345
  int32_t nthread; // number of threads to use for quantizing, if <=0 will use std::thread::hardware_concurrency()
346
346
  enum llama_ftype ftype; // quantize to this llama_ftype
347
347
  enum lm_ggml_type output_tensor_type; // output tensor type
348
- enum lm_ggml_type token_embedding_type; // itoken embeddings tensor type
348
+ enum lm_ggml_type token_embedding_type; // token embeddings tensor type
349
349
  bool allow_requantize; // allow quantizing non-f32/f16 tensors
350
350
  bool quantize_output_tensor; // quantize output.weight
351
351
  bool only_copy; // only copy tensors - ftype, allow_requantize and quantize_output_tensor are ignored
@@ -504,6 +504,9 @@ extern "C" {
504
504
  // Returns true if the model contains an encoder that requires llama_encode() call
505
505
  LLAMA_API bool llama_model_has_encoder(const struct llama_model * model);
506
506
 
507
+ // Returns true if the model contains a decoder that requires llama_decode() call
508
+ LLAMA_API bool llama_model_has_decoder(const struct llama_model * model);
509
+
507
510
  // For encoder-decoder models, this function returns id of the token that must be provided
508
511
  // to the decoder to start generating output sequence. For other models, it returns -1.
509
512
  LLAMA_API llama_token llama_model_decoder_start_token(const struct llama_model * model);
package/cpp/rn-llama.hpp CHANGED
@@ -6,13 +6,10 @@
6
6
  #include "common.h"
7
7
  #include "llama.h"
8
8
 
9
-
10
9
  #include <android/log.h>
11
10
  #define LLAMA_ANDROID_TAG "RNLLAMA_LOG_ANDROID"
12
11
  #define LLAMA_LOG_INFO(...) __android_log_print(ANDROID_LOG_INFO , LLAMA_ANDROID_TAG, __VA_ARGS__)
13
12
 
14
-
15
-
16
13
  namespace rnllama {
17
14
 
18
15
  static void llama_batch_clear(llama_batch *batch) {
@@ -227,7 +224,9 @@ struct llama_rn_context
227
224
  bool loadModel(gpt_params &params_)
228
225
  {
229
226
  params = params_;
230
- std::tie(model, ctx) = llama_init_from_gpt_params(params);
227
+ llama_init_result result = llama_init_from_gpt_params(params);
228
+ model = result.model;
229
+ ctx = result.context;
231
230
  if (model == nullptr)
232
231
  {
233
232
  LOG_ERROR("unable to load model: %s", params_.model.c_str());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cui-llama.rn",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Fork of llama.rn for ChatterUI",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",