llama-sampling.h 754 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. // TODO: rename llama-sampling.h/.cpp to llama-sampler.h/.cpp ?
  3. #include "llama.h"
  4. #include <vector>
  5. struct llama_vocab;
  6. struct llama_grammar;
  7. // sampler chain
  8. struct llama_sampler_chain {
  9. llama_sampler_chain_params params;
  10. std::vector<struct llama_sampler *> samplers;
  11. // timing
  12. mutable int64_t t_sample_us;
  13. mutable int32_t n_sample;
  14. };
  15. struct llama_sampler * llama_sampler_init_dry_testing(
  16. int32_t context_size,
  17. float dry_multiplier,
  18. float dry_base,
  19. int32_t dry_allowed_length,
  20. int32_t dry_penalty_last_n,
  21. const std::vector<std::vector<llama_token>>& seq_breakers);