fail llama_sampler_init_llg() at runtime
This commit is contained in:
parent
437ff3178c
commit
5475357458
2 changed files with 16 additions and 11 deletions
|
@ -1,14 +1,14 @@
|
|||
#include "common.h"
|
||||
#include "sampling.h"
|
||||
#include "log.h"
|
||||
#include "llama.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#ifdef LLAMA_USE_LLGUIDANCE
|
||||
|
||||
# include "common.h"
|
||||
# include "sampling.h"
|
||||
# include "log.h"
|
||||
# include "llama.h"
|
||||
|
||||
# include "llguidance.h"
|
||||
|
||||
# include <cmath>
|
||||
|
||||
struct llama_sampler_llg {
|
||||
const llama_vocab * vocab;
|
||||
std::string grammar_kind;
|
||||
|
@ -263,4 +263,11 @@ llama_sampler * llama_sampler_init_llg(const llama_vocab * vocab, const char * g
|
|||
};
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
llama_sampler * llama_sampler_init_llg(const llama_vocab *, const char *, const char *) {
|
||||
LOG_WRN("llguidance (cmake -DLLAMA_LLGUIDANCE=ON) is not enabled");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#endif // LLAMA_USE_LLGUIDANCE
|
||||
|
|
|
@ -103,7 +103,5 @@ std::string common_sampler_type_to_str(enum common_sampler_type cnstr);
|
|||
std::vector<enum common_sampler_type> common_sampler_types_from_names(const std::vector<std::string> & names, bool allow_alt_names);
|
||||
std::vector<enum common_sampler_type> common_sampler_types_from_chars(const std::string & chars);
|
||||
|
||||
#ifdef LLAMA_USE_LLGUIDANCE
|
||||
struct llama_sampler * llama_sampler_init_llg(const llama_vocab * vocab,
|
||||
const char * grammar_kind, const char * grammar_data);
|
||||
#endif // LLAMA_USE_LLGUIDANCE
|
||||
llama_sampler * llama_sampler_init_llg(const llama_vocab * vocab,
|
||||
const char * grammar_kind, const char * grammar_data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue