diff --git a/common/arg.cpp b/common/arg.cpp index d7fd21254..86f951aab 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -948,14 +948,14 @@ common_params_context common_params_parser_init(common_params & params, llama_ex } ).set_sparam()); add_opt(common_arg( - {"-xtc-p", "--xtc-probability"}, "N", + {"--xtc-probability"}, "N", string_format("xtc probability (default: %.1f, 0.0 = disabled)", (double)params.sparams.xtc_probability), [](common_params & params, const std::string & value) { params.sparams.xtc_probability = std::stof(value); } ).set_sparam()); add_opt(common_arg( - {"-xtc-t", "--xtc-threshold"}, "N", + {"--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); diff --git a/common/common.cpp b/common/common.cpp index 873b2c694..c08f01b42 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -2104,7 +2104,7 @@ void yaml_dump_non_result_info(FILE * stream, const common_params & params, cons fprintf(stream, "top_k: %d # default: 40\n", sparams.top_k); fprintf(stream, "top_p: %f # default: 0.95\n", sparams.top_p); fprintf(stream, "min_p: %f # default: 0.0\n", sparams.min_p); - fprintf(stream, "xtc_probability: %f # default: 0.5\n", sparams.xtc_probability); + fprintf(stream, "xtc_probability: %f # default: 0.0\n", sparams.xtc_probability); fprintf(stream, "xtc_threshold: %f # default: 0.1\n", sparams.xtc_threshold); fprintf(stream, "typ_p: %f # default: 1.0\n", sparams.typ_p); fprintf(stream, "verbose_prompt: %s # default: false\n", params.verbose_prompt ? "true" : "false"); diff --git a/common/common.h b/common/common.h index 932c3f47f..3a378408e 100644 --- a/common/common.h +++ b/common/common.h @@ -111,7 +111,7 @@ struct common_sampler_params { float top_p = 0.95f; // 1.0 = disabled float min_p = 0.05f; // 0.0 = disabled float xtc_probability = 0.00f; // 0.0 = disabled - float xtc_threshold = 0.10f; // 0.5 = disabled + float xtc_threshold = 0.10f; // > 0.5 disables XTC float tfs_z = 1.00f; // 1.0 = disabled float typ_p = 1.00f; // typical_p, 1.0 = disabled float temp = 0.80f; // <= 0.0 to sample greedily, 0.0 to not output probabilities diff --git a/examples/server/public/index-new.html b/examples/server/public/index-new.html index ee7a10f40..ad4183cd9 100644 --- a/examples/server/public/index-new.html +++ b/examples/server/public/index-new.html @@ -44,7 +44,7 @@ top_p: 1.0, // 1.0 = disabled min_p: 0.05, // 0 = disabled; recommended for non-english: ~ 0.4 xtc_probability: 0.0, // 0 = disabled; - xtc_threshold: 0.1, // 0.5 = disabled; + xtc_threshold: 0.1, // > 0.5 disables XTC; tfs_z: 1.0, // 1.0 = disabled typical_p: 1.0, // 1.0 = disabled presence_penalty: 0.0, // 0.0 = disabled diff --git a/examples/server/public/index.html b/examples/server/public/index.html index 88e6af08e..88065705f 100644 --- a/examples/server/public/index.html +++ b/examples/server/public/index.html @@ -308,7 +308,7 @@ top_p: 0.95, // 1.0 = disabled min_p: 0.05, // 0 = disabled xtc_probability: 0.0, // 0 = disabled; - xtc_threshold: 0.1, // 0.5 = disabled; + xtc_threshold: 0.1, // > 0.5 disables XTC; tfs_z: 1.0, // 1.0 = disabled typical_p: 1.0, // 1.0 = disabled presence_penalty: 0.0, // 0.0 = disabled diff --git a/src/llama-sampling.cpp b/src/llama-sampling.cpp index 225df5212..708d5e669 100644 --- a/src/llama-sampling.cpp +++ b/src/llama-sampling.cpp @@ -1081,7 +1081,7 @@ static void llama_sample_xtc_apply(struct llama_sampler * smpl, llama_token_data if (ctx->probability <= 0.0f || ctx->threshold > 0.5f - || cur_p->size <= 2) { + || cur_p->size < 2) { return; }