Add grammar for ooba llama.cpp

This commit is contained in:
Cohee 2023-09-24 17:57:00 +03:00
parent 423f88a458
commit 86e9974410
2 changed files with 15 additions and 0 deletions

View File

@ -1612,6 +1612,18 @@
</div>
</div>
<hr>
<div id="grammar_block_ooba">
<h4 data-i18n="Grammar">Grammar</h4>
<div class="range-block">
<textarea id="grammar_file_textgenerationwebui" rows="2" class="text_pole textarea_compact monospace"></textarea>
<div class="toggle-description justifyLeft">
<span data-i18n="Type in the desired custom grammar (GBNF).">
Type in the desired custom grammar (<a href="https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md" target="_blank">GBNF</a>).
</span>
</div>
</div>
</div>
<hr>
<div class="range-block">
<div class="range-block-title" data-i18n="Seed">
Seed

View File

@ -50,6 +50,7 @@ const textgenerationwebui_settings = {
mirostat_eta: 0.1,
guidance_scale: 1,
negative_prompt: '',
grammar_file: '',
};
export let textgenerationwebui_presets = [];
@ -85,6 +86,7 @@ const setting_names = [
"mirostat_eta",
"guidance_scale",
"negative_prompt",
"grammar_file",
];
function selectPreset(name) {
@ -266,5 +268,6 @@ export function getTextGenGenerationData(finalPrompt, this_amount_gen, isImperso
'mirostat_mode': textgenerationwebui_settings.mirostat_mode,
'mirostat_tau': textgenerationwebui_settings.mirostat_tau,
'mirostat_eta': textgenerationwebui_settings.mirostat_eta,
'grammar_file': textgenerationwebui_settings.grammar_file,
};
}