add warning message if EOS is disabled
This commit is contained in:
parent
f7f1d266e3
commit
4cd9711dac
1 changed files with 8 additions and 0 deletions
|
@ -350,6 +350,14 @@ int main(int argc, char ** argv) {
|
||||||
grammar_parser::print_grammar(stderr, parsed_grammar);
|
grammar_parser::print_grammar(stderr, parsed_grammar);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
|
{
|
||||||
|
auto it = params.logit_bias.find(llama_token_eos());
|
||||||
|
if (it != params.logit_bias.end() && it->second == -INFINITY) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"%s: warning: EOS token is disabled, which will cause most grammars to fail\n", __func__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<const llama_grammar_element *> grammar_rules(parsed_grammar.c_rules());
|
std::vector<const llama_grammar_element *> grammar_rules(parsed_grammar.c_rules());
|
||||||
grammar = llama_grammar_init(
|
grammar = llama_grammar_init(
|
||||||
grammar_rules.data(), grammar_rules.size(), parsed_grammar.symbol_ids.at("root"));
|
grammar_rules.data(), grammar_rules.size(), parsed_grammar.symbol_ids.at("root"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue