Skip to content

Commit 44bbd63

Browse files
committed
Quick fixes by comments
1 parent cca842f commit 44bbd63

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

common/arg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,14 +948,14 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
948948
}
949949
).set_sparam());
950950
add_opt(common_arg(
951-
{"-xtc-p", "--xtc-probability"}, "N",
951+
{"--xtc-probability"}, "N",
952952
string_format("xtc probability (default: %.1f, 0.0 = disabled)", (double)params.sparams.xtc_probability),
953953
[](common_params & params, const std::string & value) {
954954
params.sparams.xtc_probability = std::stof(value);
955955
}
956956
).set_sparam());
957957
add_opt(common_arg(
958-
{"-xtc-t", "--xtc-threshold"}, "N",
958+
{"--xtc-threshold"}, "N",
959959
string_format("xtc threshold (default: %.1f, 1.0 = disabled)", (double)params.sparams.xtc_threshold),
960960
[](common_params & params, const std::string & value) {
961961
params.sparams.xtc_threshold = std::stof(value);

common/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,7 @@ void yaml_dump_non_result_info(FILE * stream, const common_params & params, cons
21042104
fprintf(stream, "top_k: %d # default: 40\n", sparams.top_k);
21052105
fprintf(stream, "top_p: %f # default: 0.95\n", sparams.top_p);
21062106
fprintf(stream, "min_p: %f # default: 0.0\n", sparams.min_p);
2107-
fprintf(stream, "xtc_probability: %f # default: 0.5\n", sparams.xtc_probability);
2107+
fprintf(stream, "xtc_probability: %f # default: 0.0\n", sparams.xtc_probability);
21082108
fprintf(stream, "xtc_threshold: %f # default: 0.1\n", sparams.xtc_threshold);
21092109
fprintf(stream, "typ_p: %f # default: 1.0\n", sparams.typ_p);
21102110
fprintf(stream, "verbose_prompt: %s # default: false\n", params.verbose_prompt ? "true" : "false");

common/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ struct common_sampler_params {
111111
float top_p = 0.95f; // 1.0 = disabled
112112
float min_p = 0.05f; // 0.0 = disabled
113113
float xtc_probability = 0.00f; // 0.0 = disabled
114-
float xtc_threshold = 0.10f; // 0.5 = disabled
114+
float xtc_threshold = 0.10f; // > 0.5 disables XTC
115115
float tfs_z = 1.00f; // 1.0 = disabled
116116
float typ_p = 1.00f; // typical_p, 1.0 = disabled
117117
float temp = 0.80f; // <= 0.0 to sample greedily, 0.0 to not output probabilities

examples/server/public/index-new.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
top_p: 1.0, // 1.0 = disabled
4545
min_p: 0.05, // 0 = disabled; recommended for non-english: ~ 0.4
4646
xtc_probability: 0.0, // 0 = disabled;
47-
xtc_threshold: 0.1, // 0.5 = disabled;
47+
xtc_threshold: 0.1, // > 0.5 disables XTC;
4848
tfs_z: 1.0, // 1.0 = disabled
4949
typical_p: 1.0, // 1.0 = disabled
5050
presence_penalty: 0.0, // 0.0 = disabled

examples/server/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
top_p: 0.95, // 1.0 = disabled
309309
min_p: 0.05, // 0 = disabled
310310
xtc_probability: 0.0, // 0 = disabled;
311-
xtc_threshold: 0.1, // 0.5 = disabled;
311+
xtc_threshold: 0.1, // > 0.5 disables XTC;
312312
tfs_z: 1.0, // 1.0 = disabled
313313
typical_p: 1.0, // 1.0 = disabled
314314
presence_penalty: 0.0, // 0.0 = disabled

src/llama-sampling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ static void llama_sample_xtc_apply(struct llama_sampler * smpl, llama_token_data
10811081

10821082
if (ctx->probability <= 0.0f
10831083
|| ctx->threshold > 0.5f
1084-
|| cur_p->size <= 2) {
1084+
|| cur_p->size < 2) {
10851085
return;
10861086
}
10871087

0 commit comments

Comments
 (0)