From 38fa660d4885b5c8eecf6fa50665c529d58924f2 Mon Sep 17 00:00:00 2001 From: Jhen-Jie Hong Date: Sat, 16 Nov 2024 18:56:18 +0800 Subject: [PATCH] feat: no longer need disable mmap for lora --- android/src/main/jni.cpp | 1 - ios/RNLlamaContext.mm | 1 - 2 files changed, 2 deletions(-) diff --git a/android/src/main/jni.cpp b/android/src/main/jni.cpp index 4475c95..6bbca6d 100644 --- a/android/src/main/jni.cpp +++ b/android/src/main/jni.cpp @@ -278,7 +278,6 @@ Java_com_rnllama_LlamaContext_initContext( const char *lora_chars = env->GetStringUTFChars(lora_str, nullptr); if (lora_chars != nullptr && lora_chars[0] != '\0') { defaultParams.lora_adapters.push_back({lora_chars, lora_scaled}); - defaultParams.use_mmap = false; } defaultParams.rope_freq_base = rope_freq_base; diff --git a/ios/RNLlamaContext.mm b/ios/RNLlamaContext.mm index e4d22ec..e501a18 100644 --- a/ios/RNLlamaContext.mm +++ b/ios/RNLlamaContext.mm @@ -114,7 +114,6 @@ + (instancetype)initWithParams:(NSDictionary *)params onProgress:(void (^)(unsig float lora_scaled = 1.0f; if (params[@"lora_scaled"]) lora_scaled = [params[@"lora_scaled"] floatValue]; defaultParams.lora_adapters.push_back({[params[@"lora"] UTF8String], lora_scaled}); - defaultParams.use_mmap = false; } if (params[@"rope_freq_base"]) defaultParams.rope_freq_base = [params[@"rope_freq_base"] floatValue];