Skip to content

Commit

Permalink
add retain state button for grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
Concedo authored and Concedo committed Oct 1, 2023
1 parent 0a55047 commit 694558e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5846,6 +5846,7 @@
}

document.getElementById("setgrammar").disabled = !is_using_kcpp_with_grammar();
document.getElementById("grammar_retain_state").disabled = document.getElementById("setgrammar").disabled;

if(custom_kobold_endpoint!="")
{
Expand Down Expand Up @@ -7029,6 +7030,7 @@
if(localsettings.grammar && localsettings.grammar!="")
{
submit_payload.params.grammar = localsettings.grammar;
submit_payload.params.grammar_retain_state = document.getElementById("grammar_retain_state").checked;
}
}

Expand Down Expand Up @@ -10226,6 +10228,8 @@
<div class="settinglabel">
<div class="justifyleft settingsmall">Additional Configs <span class="helpicon">?<span class="helptext">Grammar Sampling (KCPP) - Allows you to constrain output to fit specific structures.</span></span></div>
<button id="setgrammar" type="button" class="btn btn-primary" style="padding:2px 3px;margin-top:2px;font-size:11px;" onclick="selectGrammar()">Set Grammar</button>
<div class="settingsmall" style="padding:2px 3px;margin-top:4px;" title="Do not reset grammar on generate. May not work with multiple users.">Retain </div>
<input type="checkbox" id="grammar_retain_state" style="padding:2px 3px;margin-top:6px;height: max-content;">
</div>
</div>
</div>
Expand Down

0 comments on commit 694558e

Please sign in to comment.