Skip to content

Commit 72db625

Browse files
committed
Added XTC to server UIs
1 parent f7a383f commit 72db625

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

examples/server/public/index-new.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
top_k: 0, // <= 0 to use vocab size
4444
top_p: 1.0, // 1.0 = disabled
4545
min_p: 0.05, // 0 = disabled; recommended for non-english: ~ 0.4
46+
xtc_probability: 0.0, // 0 = disabled;
47+
xtc_threshold: 0.1, // 0.5 = disabled;
48+
xtc_threshold_max: 1.0, // 0 = disabled;
4649
tfs_z: 1.0, // 1.0 = disabled
4750
typical_p: 1.0, // 1.0 = disabled
4851
presence_penalty: 0.0, // 0.0 = disabled
@@ -836,6 +839,9 @@
836839
${FloatField({ label: "TFS-Z", title: "Activates tail-free sampling, a method used to limit the prediction of tokens that are too frequent. The parameter z controls the strength of this limitation. A value of 1.0 means that this function is deactivated.", max: 1.0, min: 0.0, name: "tfs_z", step: 0.01, value: params.value.tfs_z })}
837840
${FloatField({ label: "Frequency Penalty", title: "A penalty that is applied based on the frequency with which certain tokens occur in the training data set. A higher value results in rare tokens being favoured.", max: 1.0, min: 0.0, name: "frequency_penalty", step: 0.01, value: params.value.frequency_penalty })}
838841
${FloatField({ label: "Typical-P", title: "Activates local typical sampling, a method used to limit the prediction of tokens that are atypical in the current context. The parameter p controls the strength of this limitation. A value of 1.0 means that this function is deactivated.", max: 1.0, min: 0.0, name: "typical_p", step: 0.01, value: params.value.typical_p })}
842+
${FloatField({ label: "XTC probability", title: "Sets the chance for token removal (checked once on sampler start)", max: 1.0, min: 0.0, name: "xtc_probability", step: 0.01, value: params.value.xtc_probability })}
843+
${FloatField({ label: "XTC threshold", title: "Sets a minimum probability threshold for tokens to be removed", max: 0.5, min: 0.0, name: "xtc_threshold", step: 0.01, value: params.value.xtc_threshold })}
844+
${FloatField({ label: "XTC max threshold", title: "Sets a maximum probability threshold for tokens to be removed (highly experimental)", max: 1.0, min: 0.0, name: "xtc_threshold_max", step: 0.01, value: params.value.xtc_threshold_max })}
839845
${IntField({ label: "Min Keep", title: "If greater than 0, samplers are forced to return N possible tokens at minimum. Default is 0", max: 10, min: 0, name: "min_keep", value: params.value.min_keep })}
840846
</fieldset>
841847
@@ -1132,6 +1138,9 @@ <h2>llama.cpp</h2>
11321138
const snapSettings = {
11331139
temperature: { snapValue: 1.0, snapRangeMultiplier: 6 },
11341140
min_p: { snapValue: 0.05, snapRangeMultiplier: 2 },
1141+
xtc_probability: { snapValue: 0.0, snapRangeMultiplier: 4 },
1142+
xtc_threshold: { snapValue: 0.5, snapRangeMultiplier: 4 },
1143+
xtc_threshold_max: { snapValue: 1.0, snapRangeMultiplier: 4 },
11351144
top_p: { snapValue: 1.0, snapRangeMultiplier: 4 },
11361145
tfs_z: { snapValue: 1.0, snapRangeMultiplier: 4 },
11371146
typical_p: { snapValue: 1.0, snapRangeMultiplier: 4 },

examples/server/public/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@
307307
top_k: 40, // <= 0 to use vocab size
308308
top_p: 0.95, // 1.0 = disabled
309309
min_p: 0.05, // 0 = disabled
310+
xtc_probability: 0.0, // 0 = disabled;
311+
xtc_threshold: 0.1, // 0.5 = disabled;
312+
xtc_threshold_max: 1.0, // 0 = disabled;
310313
tfs_z: 1.0, // 1.0 = disabled
311314
typical_p: 1.0, // 1.0 = disabled
312315
presence_penalty: 0.0, // 0.0 = disabled
@@ -1013,6 +1016,9 @@
10131016
${FloatField({ label: "Typical P", max: 1.0, min: 0.0, name: "typical_p", step: 0.01, value: params.value.typical_p })}
10141017
${FloatField({ label: "Presence penalty", max: 1.0, min: 0.0, name: "presence_penalty", step: 0.01, value: params.value.presence_penalty })}
10151018
${FloatField({ label: "Frequency penalty", max: 1.0, min: 0.0, name: "frequency_penalty", step: 0.01, value: params.value.frequency_penalty })}
1019+
${FloatField({ label: "xtc_probability", max: 1.0, min: 0.0, name: "xtc_probability", step: 0.01, value: params.value.xtc_probability })}
1020+
${FloatField({ label: "xtc_threshold", max: 0.5, min: 0.0, name: "xtc_threshold", step: 0.01, value: params.value.xtc_threshold })}
1021+
${FloatField({ label: "xtc_threshold_max", max: 1.0, min: 0.0, name: "xtc_threshold_max", step: 0.01, value: params.value.xtc_threshold_max })}
10161022
</fieldset>
10171023
<hr />
10181024
<fieldset class="three">

0 commit comments

Comments
 (0)