We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently not integrated in whisper_encode
Removed from main.cpp the following snippet
if (!params.grammar.empty()) { auto & grammar = params.grammar_parsed; if (is_file_exist(params.grammar.c_str())) { // read grammar from file std::ifstream ifs(params.grammar.c_str()); const std::string txt = std::string((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()); grammar = grammar_parser::parse(txt.c_str()); } else { // read grammar from string grammar = grammar_parser::parse(params.grammar.c_str()); } // will be empty (default) if there are parse errors if (grammar.rules.empty()) { fprintf(stderr, "error: failed to parse grammar \"%s\"\n", params.grammar.c_str()); return 4; } else { fprintf(stderr, "%s: grammar:\n", __func__); grammar_parser::print_grammar(stderr, grammar); fprintf(stderr, "\n"); } }
as well as the following grammar-related relevant snippet
const auto & grammar_parsed = params.grammar_parsed; auto grammar_rules = grammar_parsed.c_rules(); if (use_grammar) { if (grammar_parsed.symbol_ids.find(params.grammar_rule) == grammar_parsed.symbol_ids.end()) { fprintf(stderr, "%s: warning: grammar rule '%s' not found - skipping grammar sampling\n", __func__, params.grammar_rule.c_str()); } else { wparams.grammar_rules = grammar_rules.data(); wparams.n_grammar_rules = grammar_rules.size(); wparams.i_start_rule = grammar_parsed.symbol_ids.at(params.grammar_rule); wparams.grammar_penalty = params.grammar_penalty; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently not integrated in whisper_encode
Removed from main.cpp the following snippet
as well as the following grammar-related relevant snippet
The text was updated successfully, but these errors were encountered: