server : make n_probs max to 10 for easy scroll

This commit is contained in:
Jhen 2023-08-02 16:14:40 +08:00
parent 7f02fead8c
commit 368c41cb5b

View file

@ -102,6 +102,18 @@
padding: 0.5em; padding: 0.5em;
} }
.prob-set {
padding: 0.3em;
border-bottom: 1px solid #ccc;
}
.popover-content {
position: absolute;
background-color: #777;
border: 1px solid #ccc;
padding: 0.2em;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
textarea { textarea {
padding: 5px; padding: 5px;
@ -397,7 +409,7 @@
${FloatField({label: "Mirostat eta", max: 1.0, min: 0.0, name: "mirostat_eta", step: 0.01, value: params.value.mirostat_eta})} ${FloatField({label: "Mirostat eta", max: 1.0, min: 0.0, name: "mirostat_eta", step: 0.01, value: params.value.mirostat_eta})}
</fieldset> </fieldset>
<fieldset> <fieldset>
${IntField({label: "Show Probabilities", max: 100, min: 0, name: "n_probs", value: params.value.n_probs})} ${IntField({label: "Show Probabilities", max: 10, min: 0, name: "n_probs", value: params.value.n_probs})}
</fieldset> </fieldset>
</details> </details>
</form> </form>
@ -425,7 +437,7 @@
<div> <div>
${completion_probabilities.map((cp, i) => { ${completion_probabilities.map((cp, i) => {
return html` return html`
<div key={i} style=${{ borderBottom: '1px solid #ccc', padding: '0.3em' }}> <div key={i} class="prob-set">
${cp.probs.map((p, j) => { ${cp.probs.map((p, j) => {
return html` return html`
<div key=${`${i}-${j}`} style=${{ <div key=${`${i}-${j}`} style=${{
@ -514,14 +526,10 @@
<${Portal} into="#portal"> <${Portal} into="#portal">
<div <div
ref=${popoverRef} ref=${popoverRef}
class="popover-content"
style=${{ style=${{
position: 'absolute',
top: position.value.top, top: position.value.top,
left: position.value.left, left: position.value.left,
backgroundColor: '#777',
border: '1px solid #ccc',
padding: '4px',
boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)',
}} }}
> >
${props.popoverChildren} ${props.popoverChildren}