sampling : fix off-by-one in tail-free sampling

ggml-ci
This commit is contained in:
Georgi Gerganov
2024-09-23 11:44:55 +03:00
parent 37f8c7b4c9
commit 114ab6347e
3 changed files with 9 additions and 7 deletions

View File

@ -963,7 +963,7 @@ gpt_params_context gpt_params_parser_init(gpt_params & params, llama_example ex,
}
).set_sparam());
add_opt(llama_arg(
{"--tfs"}, "N",
{"--tfs", "--tfs-z"}, "Z",
format("tail free sampling, parameter z (default: %.1f, 1.0 = disabled)", (double)params.sparams.tfs_z),
[](gpt_params & params, const std::string & value) {
params.sparams.tfs_z = std::stof(value);