Skip to content

Commit fb4eb13

Browse files
committed
Merge remote-tracking branch 'origin/master' into gilad/fixVulkanMemoryBudget
# Conflicts: # llama/addon/AddonContext.cpp
2 parents 5f21e4f + 76b505e commit fb4eb13

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

llama/addon/AddonContext.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -420,16 +420,8 @@ AddonContext::AddonContext(const Napi::CallbackInfo& info) : Napi::ObjectWrap<Ad
420420
}
421421

422422
if (options.Has("flashAttention")) {
423-
if (options.Get("flashAttention").IsBoolean()) {
424-
bool value = options.Get("flashAttention").As<Napi::Boolean>().Value();
425-
if (value) {
426-
context_params.flash_attn_type = LLAMA_FLASH_ATTN_TYPE_ENABLED;
427-
} else {
428-
context_params.flash_attn_type = LLAMA_FLASH_ATTN_TYPE_DISABLED;
429-
}
430-
} else {
431-
context_params.flash_attn_type = LLAMA_FLASH_ATTN_TYPE_AUTO;
432-
}
423+
bool flashAttention = options.Get("flashAttention").As<Napi::Boolean>().Value();
424+
context_params.flash_attn_type = flashAttention ? LLAMA_FLASH_ATTN_TYPE_ENABLED : LLAMA_FLASH_ATTN_TYPE_DISABLED;
433425
}
434426

435427
if (options.Has("threads")) {

0 commit comments

Comments
 (0)