mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-13 04:00:16 +00:00
sampling : fix malloc
ggml-ci
This commit is contained in:
parent
0d96efabb5
commit
b5554b9e05
@ -1,8 +1,7 @@
|
||||
#include "sampling.h"
|
||||
|
||||
struct llama_sampling_context * llama_sampling_init(const struct gpt_params & params) {
|
||||
struct llama_sampling_context * result =
|
||||
(struct llama_sampling_context *) malloc(sizeof(struct llama_sampling_context));
|
||||
struct llama_sampling_context * result = new llama_sampling_context();
|
||||
|
||||
result->params = params.sampling_params;
|
||||
result->grammar = nullptr;
|
||||
@ -34,7 +33,7 @@ void llama_sampling_free(struct llama_sampling_context * ctx) {
|
||||
llama_grammar_free(ctx->grammar);
|
||||
}
|
||||
|
||||
free(ctx);
|
||||
delete ctx;
|
||||
}
|
||||
|
||||
void llama_sampling_reset(llama_sampling_context * ctx) {
|
||||
|
Loading…
Reference in New Issue
Block a user