CoolFace
Modelpublic

Felipe97/llama-cpp-compiled

sourceHugging Faceupdated 3d agoView on Hugging Face
0likes1.1kdownloads
llama-sampler.h47 linesDownload Raw Back to src
1#pragma once2 3#include "llama.h"4 5#include <vector>6 7struct llama_vocab;8struct llama_grammar;9 10// sampler chain11 12struct llama_sampler_chain {13    llama_sampler_chain_params params;14 15    // has .backend_init() been called?16    bool is_init = false;17 18    uint32_t n_nodes = 0;19 20    struct info {21        bool is_backend;22 23        llama_sampler * ptr;24    };25 26    std::vector<info> samplers;27 28    // pre-allocated buffer for llama_sampler_sample to avoid repeated allocations29    std::vector<llama_token_data> cur;30 31    // timing32 33    mutable int64_t t_sample_us;34 35    mutable 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(42        float   dry_multiplier,43        float   dry_base,44        int32_t dry_allowed_length,45        int32_t dry_penalty_last_n,46        const std::vector<std::vector<llama_token>> & seq_breakers);47