|
40 | 40 | repeat_last_n: 0, // 0 = disable penalty, -1 = context size |
41 | 41 | repeat_penalty: 1.0, // 1.0 = disabled |
42 | 42 | penalize_nl: false, // true only useful for infinite completion |
| 43 | + dry_multiplier: 0.0, // 0.0 = disabled, 0.8 works well |
| 44 | + dry_base: 1.75, // 0.0 = disabled |
| 45 | + dry_allowed_length: 2, // tokens extending repetitions beyond this receive penalty, 2 works well |
| 46 | + dry_penalty_last_n: -1, // how many tokens to scan for repetitions (0 = disable penalty, -1 = context size) |
43 | 47 | top_k: 0, // <= 0 to use vocab size |
44 | 48 | top_p: 1.0, // 1.0 = disabled |
45 | 49 | min_p: 0.05, // 0 = disabled; recommended for non-english: ~ 0.4 |
|
833 | 837 | <fieldset class="params"> |
834 | 838 | ${IntField({ label: "Top-K", title: "Limits the selection of the next token to the K most probable tokens. 1 means no randomness = greedy sampling. If set to 0, it means the entire vocabulary size is considered.", max: 100, min: 0, step: 1, name: "top_k", value: params.value.top_k })} |
835 | 839 | ${IntField({ label: "Penalize Last N", title: "The last n tokens that are taken into account to penalise repetitions. A value of 0 means that this function is deactivated and -1 means that the entire size of the context is taken into account.", max: 2048, min: 0, step: 16, name: "repeat_last_n", value: params.value.repeat_last_n })} |
836 | | - ${FloatField({ label: "Top-P", title: "Limits the selection of the next token to a subset of tokens whose combined probability reaches a threshold value P = top-P. If set to 1, it means the entire vocabulary size is considered.", max: 1.0, min: 0.0, name: "top_p", step: 0.01, value: params.value.top_p })} |
837 | 840 | ${FloatField({ label: "Presence Penalty", title: "A penalty that is applied if certain tokens appear repeatedly in the generated text. A higher value leads to fewer repetitions.", max: 1.0, min: 0.0, name: "presence_penalty", step: 0.01, value: params.value.presence_penalty })} |
838 | | - ${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 })} |
839 | 841 | ${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 })} |
| 842 | + ${FloatField({ label: "Top-P", title: "Limits the selection of the next token to a subset of tokens whose combined probability reaches a threshold value P = top-P. If set to 1, it means the entire vocabulary size is considered.", max: 1.0, min: 0.0, name: "top_p", step: 0.01, value: params.value.top_p })} |
840 | 843 | ${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 })} |
841 | 844 | ${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 })} |
842 | 845 | ${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 })} |
| 846 | + ${FloatField({ label: "DRY Penalty Multiplier", title: "Set the DRY repetition penalty multiplier. Default is 0.0, which is disabled.", max: 5.0, min: 0.0, name: "dry_multiplier", step: 0.01, value: params.value.dry_multiplier })} |
| 847 | + ${FloatField({ label: "DRY Base", title: "Set the DRY repetition penalty base value. Default is 1.75", max: 3.0, min: 1.0, name: "dry_base", step: 0.01, value: params.value.dry_base })} |
| 848 | + ${IntField({ label: "DRY Allowed Length", title: "Tokens that extend repetition beyond this receive exponentially increasing penalty. Default is 2", max: 10, min: 2, step: 1, name: "dry_allowed_length", value: params.value.dry_allowed_length })} |
| 849 | + ${IntField({ label: "DRY Penalty Last N", title: "How many tokens to scan for repetitions. Default is -1, where 0 is disabled and -1 is context size", max: 2048, min: -1, step: 16, name: "dry_penalty_last_n", value: params.value.dry_penalty_last_n })} |
| 850 | + ${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 })} |
843 | 851 | ${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 })} |
844 | | - </fieldset> |
| 852 | + </fieldset> |
845 | 853 |
|
846 | 854 | <hr style="height: 1px; background-color: #ececf1; border: none;" /> |
847 | 855 |
|
@@ -1144,6 +1152,8 @@ <h2>llama.cpp</h2> |
1144 | 1152 | repeat_penalty: { snapValue: 1.0, snapRangeMultiplier: 4 }, |
1145 | 1153 | presence_penalty: { snapValue: 0.0, snapRangeMultiplier: 4 }, |
1146 | 1154 | frequency_penalty: { snapValue: 0.0, snapRangeMultiplier: 4 }, |
| 1155 | + dry_multiplier: { snapValue: 0.0, snapRangeMultiplier: 4 }, |
| 1156 | + dry_base: { snapValue: 1.75, snapRangeMultiplier: 4 }, |
1147 | 1157 | }; |
1148 | 1158 | // add an event listener for each slider |
1149 | 1159 | Object.keys(snapSettings).forEach(sliderName => { |
|
0 commit comments