mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-11-10 10:27:03 +00:00
llama : move sampling code into llama-sampling
ggml-ci
This commit is contained in:
21
src/llama-sampling.h
Normal file
21
src/llama-sampling.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "llama-impl.h"
|
||||
|
||||
struct llama_sampling {
|
||||
llama_sampling(int32_t n_vocab) : n_vocab(n_vocab) {}
|
||||
|
||||
std::mt19937 rng;
|
||||
|
||||
int64_t t_sample_us = 0;
|
||||
|
||||
int32_t n_sample = 0;
|
||||
int32_t n_vocab = 0;
|
||||
|
||||
void reset_timings() {
|
||||
t_sample_us = 0;
|
||||
n_sample = 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct llama_sampling * llama_get_sampling(struct llama_context * ctx);
|
||||
Reference in New Issue
Block a user