Repository: ggerganov/llama.cpp
File: common/arg.cpp (C++)

Code before:
        }
    ).set_sparam());
    add_opt(llama_arg(
        {"--top-p"}, "N",
        format("top-p sampling (default: %.1f, 1.0 = disabled)", (double)params.sparams.top_p),
        [](gpt_params & params, const std::string & value) {
            params.sparams.top_p = std::stof(value);
        }
    ).set_sparam());
    add_opt(llama_arg(
        {"--min-p"}, "N",
        format("min-p sampling (default: %.1f, 0.0 = disabled)", (double)params.sparams.min_p),
        [](gpt_params & params, const std::string & value) {
            params.sparams.min_p = std::stof(value);
        }
    ).set_sparam());
    add_opt(llama_arg(
        {"--xtc-p"}, "N",
        format("xtc probability (default: %.1f, 0.0 = disabled)", (double)params.sparams.xtc_p),
        [](gpt_params & params, const std::string & value) {
            params.sparams.xtc_p = std::stof(value);
        }
    ).set_sparam());
    add_opt(llama_arg(
        {"--xtc-t"}, "N",
        format("xtc threshold (default: %.1f, 0.0 = disabled)", (double)params.sparams.xtc_t),
        [](gpt_params & params, const std::string & value) {
            params.sparams.xtc_t = std::stof(value);
        }
    ).set_sparam());
    add_opt(llama_arg(
        {"--xtc-t-max"}, "N",
        format("xtc upper threshold (default: %.1f, 0.0 = disabled)", (double)params.sparams.xtc_t_max),
        [](gpt_params & params, const std::string & value) {
            params.sparams.xtc_t_max = std::stof(value);
        }
    ).set_sparam());
    add_opt(llama_arg(
        {"--tfs"}, "N",
        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);
        }
    ).set_sparam());
    add_opt(llama_arg(
        {"--typical"}, "N",
        format("locally typical sampling, parameter p (default: %.1f, 1.0 = disabled)", (double)params.sparams.typ_p),
        [](gpt_params & params, const std::string & value) {
            params.sparams.typ_p = std::stof(value);
        }
    ).set_sparam());

Review comment (suggestion):
Is `0.0 = disabled` correct? The comment in *common.h* says 1.0 = disabled, which makes more sense to me, since there could not be any probabilities above 1 to remove.

Code after:
        [](common_params & params, const std::string & value) {
            params.sparams.xtc_probability = std::stof(value);
        }
    ).set_sparam());
    add_opt(common_arg(
        {"--xtc-threshold"}, "N",
        string_format("xtc threshold (default: %.1f, 1.0 = disabled)", (double)params.sparams.xtc_threshold),
        [](common_params & params, const std::string & value) {
            params.sparams.xtc_threshold = std::stof(value);
        }
    ).set_sparam());
    add_opt(common_arg(
        {"--typical"}, "N",
        string_format("locally typical sampling, parameter p (default: %.1f, 1.0 = disabled)", (double)params.sparams.typ_p),
        [](common_params & params, const std::string & value) {
            params.sparams.typ_p = std::stof(value);
        }
    ).set_sparam());
    add_opt(common_arg(
        {"--repeat-last-n"}, "N",
        string_format("last n tokens to consider for penalize (default: %d, 0 = disabled, -1 = ctx_size)", params.sparams.penalty_last_n),
        [](common_params & params, int value) {
            params.sparams.penalty_last_n = value;
            params.sparams.n_prev = std::max(params.sparams.n_prev, params.sparams.penalty_last_n);
        }
    ).set_sparam());
    add_opt(common_arg(
        {"--repeat-penalty"}, "N",
        string_format("penalize repeat sequence of tokens (default: %.1f, 1.0 = disabled)", (double)params.sparams.penalty_repeat),
        [](common_params & params, const std::string & value) {
            params.sparams.penalty_repeat = std::stof(value);
        }
    ).set_sparam());
    add_opt(common_arg(
        {"--presence-penalty"}, "N",
        string_format("repeat alpha presence penalty (default: %.1f, 0.0 = disabled)", (double)params.sparams.penalty_present),
        [](common_params & params, const std::string & value) {
            params.sparams.penalty_present = std::stof(value);
        }
    ).set_sparam());
    add_opt(common_arg(
        {"--frequency-penalty"}, "N",
        string_format("repeat alpha frequency penalty (default: %.1f, 0.0 = disabled)", (double)params.sparams.penalty_freq),
        [](common_params & params, const std::string & value) {
            params.sparams.penalty_freq = std::stof(value);
        }
    ).set_sparam());
    add_opt(common_arg(
        {"--dynatemp-range"}, "N",
        string_format("dynamic temperature range (default: %.1f, 0.0 = disabled)", (double)params.sparams.dynatemp_range),
        [](common_params & params, const std::string & value) {