@@ -3191,17 +3191,6 @@ def llama_sampler_init_min_p(p: float, min_keep: int) -> llama_sampler_p:
31913191 ...
31923192
31933193
3194- # /// @details Tail Free Sampling described in https://www.trentonbricken.com/Tail-Free-Sampling/.
3195- # LLAMA_API struct llama_sampler * llama_sampler_init_tail_free (float z, size_t min_keep);
3196- @ctypes_function (
3197- "llama_sampler_init_tail_free" ,
3198- [ctypes .c_float , ctypes .c_size_t ],
3199- llama_sampler_p_ctypes ,
3200- )
3201- def llama_sampler_init_tail_free (z : float , min_keep : int ) -> llama_sampler_p :
3202- ...
3203-
3204-
32053194# /// @details Locally Typical Sampling implementation described in the paper https://arxiv.org/abs/2202.00666.
32063195# LLAMA_API struct llama_sampler * llama_sampler_init_typical (float p, size_t min_keep);
32073196@ctypes_function (
@@ -3343,6 +3332,41 @@ def llama_sampler_init_penalties(
33433332 ...
33443333
33453334
3335+ # /// @details DRY sampler, designed by p-e-w, as described in: https://github.com/oobabooga/text-generation-webui/pull/5677, porting Koboldcpp implementation authored by pi6am: https://github.com/LostRuins/koboldcpp/pull/982
3336+ # LLAMA_API struct llama_sampler * llama_sampler_init_dry(
3337+ # const struct llama_model * model,
3338+ # float dry_multiplier,
3339+ # float dry_base,
3340+ # int32_t dry_allowed_length,
3341+ # int32_t dry_penalty_last_n,
3342+ # const char ** seq_breakers,
3343+ # size_t num_breakers);
3344+ @ctypes_function (
3345+ "llama_sampler_init_dry" ,
3346+ [
3347+ llama_model_p_ctypes ,
3348+ ctypes .c_float ,
3349+ ctypes .c_float ,
3350+ ctypes .c_int32 ,
3351+ ctypes .c_int32 ,
3352+ ctypes .POINTER (ctypes .c_char_p ),
3353+ ctypes .c_size_t ,
3354+ ],
3355+ llama_sampler_p_ctypes ,
3356+ )
3357+ def llama_sampler_init_dry (
3358+ model : llama_model_p ,
3359+ dry_multiplier : float ,
3360+ dry_base : float ,
3361+ dry_allowed_length : int ,
3362+ dry_penalty_last_n : int ,
3363+ seq_breakers : CtypesArray [bytes ],
3364+ num_breakers : int ,
3365+ / ,
3366+ ) -> llama_sampler_p :
3367+ ...
3368+
3369+
33463370# LLAMA_API struct llama_sampler * llama_sampler_init_logit_bias(
33473371# int32_t n_vocab,
33483372# int32_t n_logit_bias,
0 commit comments