Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
ggml-ci
  • Loading branch information
ggerganov committed Jul 26, 2024
1 parent 850e853 commit 8795d1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/llama-grammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "llama-sampling.h"

#include <algorithm>
#include <stdexcept>

//
// helpers
Expand Down
8 changes: 7 additions & 1 deletion src/llama-sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ void llama_sampling_free_impl(struct llama_sampling * sampling) {
}

struct llama_sampling * llama_sampling_cp_impl(const struct llama_sampling & smpl) {
GGML_ASSERT(false); // Not implemented
auto * result = new llama_sampling(smpl.n_vocab);

if (smpl.grammar) {
result->grammar = llama_grammar_copy_impl(*smpl.grammar);
}

return result;
}

void llama_sampling_reset_impl(struct llama_sampling & smpl, const char * grammar_str, const char * grammar_root) {
Expand Down

0 comments on commit 8795d1d

Please sign in to comment.