]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
llama : use reserve/emplace_back in sampler_sample (#9534)
authorDaniel Bevenius <redacted>
Wed, 18 Sep 2024 11:42:36 +0000 (13:42 +0200)
committerGitHub <redacted>
Wed, 18 Sep 2024 11:42:36 +0000 (14:42 +0300)
commit6443ddd98576a9da904ef9f07df4e4398bb6a01a
tree3b35c62a72d417fff89cfe8ac296a72ed496b2b4
parent8a308354f6520df6bea851b435bd8054ee5617b4
llama : use reserve/emplace_back in sampler_sample (#9534)

This commit updates the llama_sampler_sample function to use reserve and
emplace_back for the vector of llama_token_data structs.

The motivation for this change is to avoid the creation of n_vocab
default-constructed llama_token_data structs which are then
immediately overwritten.
src/llama-sampling.cpp