char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
dd1ea5243
char/aliceai-t5-moe
1#pragma once 2 3#include "llama.h" 4 5#include <vector> 6 7struct llama_vocab ; 8struct llama_grammar ; 9 10// sampler chain 11 12struct llama_sampler_chain { 13llama_sampler_chain_params params ; 14 15// has .backend_init() been called? 16bool is_init = false; 17 18uint32_t n_nodes = 0 ; 19 20struct info { 21bool is_backend ; 22 23llama_sampler * ptr ; 24 }; 25 26std ::vector < info > samplers ; 27 28// pre-allocated buffer for llama_sampler_sample to avoid repeated allocations 29std ::vector < llama_token_data > cur ; 30 31// timing 32 33mutable int64_t t_sample_us ; 34 35mutable int32_t n_sample ; 36}; 37 38uint32_t llama_sampler_backend_n_nodes (const llama_sampler * sampler ); 39void llama_sampler_backend_begin (llama_sampler * sampler ); 40 41struct llama_sampler * llama_sampler_init_dry_testing ( 42float dry_multiplier , 43float dry_base , 44int32_t dry_allowed_length , 45int32_t dry_penalty_last_n , 46const std ::vector < std ::vector < llama_token >>& seq_breakers );