Skip to content

Commit

Permalink
Allow string banning with temperature 0
Browse files Browse the repository at this point in the history
lmg-anon authored Nov 30, 2024
1 parent fbbdf33 commit 3a8bd57
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions mikupad.html
Original file line number Diff line number Diff line change
@@ -6410,12 +6410,6 @@
onValueChange=${(v) => enabledSamplers.indexOf('dry') === -1
? setEnabledSamplers((es) => [...es, 'dry'])
: setEnabledSamplers((es) => es.filter((s) => s !== 'dry'))}/>
<${Checkbox} label="Banned Strings"
disabled=${!!cancel}
value=${enabledSamplers.includes('ban_tokens')}
onValueChange=${(v) => enabledSamplers.indexOf('ban_tokens') === -1
? setEnabledSamplers((es) => [...es, 'ban_tokens'])
: setEnabledSamplers((es) => es.filter((s) => s !== 'ban_tokens'))}/>
<${Checkbox} label="Top K"
disabled=${!!cancel}
value=${enabledSamplers.includes('top_k')}
@@ -6446,6 +6440,12 @@
onValueChange=${(v) => enabledSamplers.indexOf('tfs_z') === -1
? setEnabledSamplers((es) => [...es, 'tfs_z'])
: setEnabledSamplers((es) => es.filter((s) => s !== 'tfs_z'))}/>
<${Checkbox} label="Banned Strings"
disabled=${!!cancel}
value=${enabledSamplers.includes('ban_tokens')}
onValueChange=${(v) => enabledSamplers.indexOf('ban_tokens') === -1
? setEnabledSamplers((es) => [...es, 'ban_tokens'])
: setEnabledSamplers((es) => es.filter((s) => s !== 'ban_tokens'))}/>
`}>
${endpointAPI == API_OPENAI_COMPAT && html`
<${Checkbox} label="Full OpenAI Compliance"
@@ -6527,13 +6527,6 @@
readOnly=${!!cancel}
value=${drySequenceBreakers}
onValueChange=${setDrySequenceBreakers}/>`}
${enabledSamplers.includes('ban_tokens') && html`
<${InputBox} label="Banned Strings (JSON array)" type="text" pattern="^\\[.*?\\]$"
className="${bannedTokensError ? 'rejected' : ''}"
tooltip="${bannedTokensError ? bannedTokensError : ''}"
readOnly=${!!cancel}
value=${bannedTokens}
onValueChange=${setBannedTokens}/>`}
`}
${(enabledSamplers.includes('top_k') || enabledSamplers.includes('top_p') || enabledSamplers.includes('min_p')) && html`
<div className="hbox">
@@ -6561,6 +6554,13 @@
`}
`}
${(!openaiPresets || endpointAPI != API_OPENAI_COMPAT) && html`
${enabledSamplers.includes('ban_tokens') && html`
<${InputBox} label="Banned Strings (JSON array)" type="text" pattern="^\\[.*?\\]$"
className="${bannedTokensError ? 'rejected' : ''}"
tooltip="${bannedTokensError ? bannedTokensError : ''}"
readOnly=${!!cancel}
value=${bannedTokens}
onValueChange=${setBannedTokens}/>`}
<button
disabled=${!!cancel}
onClick=${() => toggleModal("grammar")}>

0 comments on commit 3a8bd57

Please sign in to comment.