Skip to content

Commit c466abe

Browse files
llama: -fa 1/0/-1 aliases for -fa on/off/auto (#15746)
1 parent 0a2a384 commit c466abe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/arg.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,11 +1548,11 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
15481548
{"-fa", "--flash-attn"}, "FA",
15491549
string_format("set Flash Attention use ('on', 'off', or 'auto', default: '%s')", llama_flash_attn_type_name(params.flash_attn_type)),
15501550
[](common_params & params, const std::string & value) {
1551-
if (value == "on" || value == "enabled") {
1551+
if (value == "on" || value == "enabled" || value == "1") {
15521552
params.flash_attn_type = LLAMA_FLASH_ATTN_TYPE_ENABLED;
1553-
} else if (value == "off" || value == "disabled") {
1553+
} else if (value == "off" || value == "disabled" || value == "0") {
15541554
params.flash_attn_type = LLAMA_FLASH_ATTN_TYPE_DISABLED;
1555-
} else if (value == "auto") {
1555+
} else if (value == "auto" || value == "-1") {
15561556
params.flash_attn_type = LLAMA_FLASH_ATTN_TYPE_AUTO;
15571557
} else {
15581558
throw std::runtime_error(string_format("error: unkown value for --flash-attn: '%s'\n", value.c_str()));

0 commit comments

Comments
 (0)