llama-cparams.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * llama.cpp - commit 46e3556e01b824e52395fb050b29804b6cff2a7c - do not edit this file
  3. *
  4. * MIT License
  5. *
  6. * Copyright (c) 2023-2024 The ggml authors
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in all
  16. * copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  24. * SOFTWARE.
  25. */
  26. #pragma once
  27. #include "llama.h"
  28. #include <cstdint>
  29. struct llama_cparams {
  30. uint32_t n_ctx; // context size used during inference
  31. uint32_t n_batch;
  32. uint32_t n_ubatch;
  33. uint32_t n_seq_max;
  34. int n_threads; // number of threads to use for generation
  35. int n_threads_batch; // number of threads to use for batch processing
  36. float rope_freq_base;
  37. float rope_freq_scale;
  38. uint32_t n_ctx_orig_yarn;
  39. // These hyperparameters are not exposed in GGUF, because all
  40. // existing YaRN models use the same values for them.
  41. float yarn_ext_factor;
  42. float yarn_attn_factor;
  43. float yarn_beta_fast;
  44. float yarn_beta_slow;
  45. float defrag_thold;
  46. bool embeddings;
  47. bool causal_attn;
  48. bool offload_kqv;
  49. bool flash_attn;
  50. bool no_perf;
  51. bool cross_attn;
  52. enum llama_pooling_type pooling_type;
  53. ggml_backend_sched_eval_callback cb_eval;
  54. void * cb_eval_user_data;
  55. };