+ {#snippet trigger()}
+
+
+ Sampling
+ {/snippet}
+
+
+ {@render samplingRow(
+ 'Temperature',
+ draft.sampling?.temperature,
+ draft.sampling?.temperature !== null && draft.sampling?.temperature !== undefined,
+ (enabled) => patchSampling({ temperature: enabled ? SAMPLING_DEFAULTS.temperature : null }),
+ (value) => patchSampling({ temperature: value }),
+ 2,
+ 0.05
+ )}
+
+ {@render samplingRow(
+ 'Top K',
+ draft.sampling?.topK,
+ draft.sampling?.topK !== null && draft.sampling?.topK !== undefined,
+ (enabled) => patchSampling({ topK: enabled ? SAMPLING_DEFAULTS.topK : null }),
+ (value) => patchSampling({ topK: value }),
+ 200,
+ 1
+ )}
+
+ {@render samplingRow(
+ 'Top P',
+ draft.sampling?.topP,
+ draft.sampling?.topP !== null && draft.sampling?.topP !== undefined,
+ (enabled) => patchSampling({ topP: enabled ? SAMPLING_DEFAULTS.topP : null }),
+ (value) => patchSampling({ topP: value }),
+ 1,
+ 0.01
+ )}
+
+ {@render samplingRow(
+ 'Min P',
+ draft.sampling?.minP,
+ draft.sampling?.minP !== null && draft.sampling?.minP !== undefined,
+ (enabled) => patchSampling({ minP: enabled ? SAMPLING_DEFAULTS.minP : null }),
+ (value) => patchSampling({ minP: value }),
+ 1,
+ 0.01
+ )}
+
+ {@render samplingRow(
+ 'Repeat Penalty',
+ draft.sampling?.repeatPenalty,
+ draft.sampling?.repeatPenalty !== null && draft.sampling?.repeatPenalty !== undefined,
+ (enabled) =>
+ patchSampling({ repeatPenalty: enabled ? SAMPLING_DEFAULTS.repeatPenalty : null }),
+ (value) => patchSampling({ repeatPenalty: value }),
+ 2,
+ 0.01
+ )}
+
+