args: lessen the blow of the deprecation

Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
This commit is contained in:
Aaron Teo 2026-03-22 23:28:30 +08:00
parent e777916d2f
commit 77aded2bdc
No known key found for this signature in database
1 changed files with 6 additions and 11 deletions

View File

@ -2208,9 +2208,8 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
{"--mlock"},
"DEPRECATED: force system to keep model in RAM rather than swapping or compressing",
[](common_params & params) {
throw std::invalid_argument("--mlock is deprecated. use --load-mode mlock instead");
GGML_UNUSED(params);
LOG_WRN("DEPRECATED: --mlock is deprecated. use --load-mode mlock instead");
params.load_mode = LLAMA_LOAD_MODE_MLOCK;
}
).set_env("LLAMA_ARG_MLOCK"));
add_opt(common_arg(
@ -2218,10 +2217,8 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
{"--no-mmap"},
"DEPRECATED: whether to memory-map model. (if mmap disabled, slower load but may reduce pageouts if not using mlock)",
[](common_params & params, bool value) {
throw std::invalid_argument("--mmap and --no-mmap are deprecated. use --load-mode mmap instead");
GGML_UNUSED(params);
GGML_UNUSED(value);
LOG_WRN("DEPRECATED: --mmap and --no-mmap are deprecated. use --load-mode mmap instead");
params.load_mode = value ? LLAMA_LOAD_MODE_MMAP : LLAMA_LOAD_MODE_NONE;
}
).set_env("LLAMA_ARG_MMAP"));
add_opt(common_arg(
@ -2229,10 +2226,8 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
{"-ndio", "--no-direct-io"},
"DEPRECATED: use DirectIO if available",
[](common_params & params, bool value) {
throw std::invalid_argument("-dio/--direct-io and -ndio/--no-direct-io are deprecated. use --load-mode dio instead");
GGML_UNUSED(params);
GGML_UNUSED(value);
LOG_WRN("DEPRECATED: -dio/--direct-io and -ndio/--no-direct-io are deprecated. use --load-mode dio instead");
params.load_mode = value ? LLAMA_LOAD_MODE_DIRECT_IO : LLAMA_LOAD_MODE_NONE;
}
).set_env("LLAMA_ARG_DIO"));
add_opt(common_arg(